Files
FsMcp/.github/plans/plan-managed-stores-pickups.prompt.md

2.3 KiB

Plan: Implement Managed Stores Pickups MCP Tools

To minimize API calls, we will implement the two necessary endpoints to first get the user's managed stores, and then fetch the upcoming pickups for each managed store.

Steps

  1. Analyze API Models: Extract the response schemas for both endpoints from fsopenapi.json to create fully typed C# record responses (e.g., StoreTeamMembershipWithPickupStatus and the occupiedSlots structure).
  2. Update Endpoints list: Add GetStoresOfUser and ListPickupsForStore relative URLs to FsMcp/Endpoints.cs.
  3. Implement User Stores Tool (parallel with step 4): Create FsMcp/Tools/UserStoresTools.cs exposing a tool to call GET /api/users/{userId}/stores. Ensure EnsureLoginAsync() is called before making requests, and fully apply [Description] attributes to fields.
  4. Implement Store Pickups Tool (parallel with step 3): Create FsMcp/Tools/StorePickupsTools.cs exposing a tool to call GET /api/stores/{storeId}/pickups. Include the occupiedSlots with their isConfirmed property.
  5. Register MCP Tools: Add .WithTools<UserStoresTools>() and .WithTools<StorePickupsTools>() inside FsMcp/Program.cs.
  6. Update Documents: Add usage instructions, auth behaviors, and endpoint mappings to FsMcp/README.md.

Relevant files

  • fsopenapi.json — Source of truth for OpenAPI schema properties
  • FsMcp/Endpoints.cs — Add static endpoint URLs
  • FsMcp/Tools/UserStoresTools.cs — Implements GET /api/users/{userId}/stores
  • FsMcp/Tools/StorePickupsTools.cs — Implements GET /api/stores/{storeId}/pickups
  • FsMcp/Program.cs — Tool registration
  • FsMcp/README.md — Documentation

Verification

  1. Execute dotnet build FsMcp/FsMcp.csproj -c Debug to verify compilation.
  2. Launch the MCP server using the provided workspace task: Run FsMcp Debug.
  3. Once running, interactively test the tools by asking: "List stores I manage and show their open unconfirmed pickups" via this chat, ensuring both tools are successfully invoked by the MCP client.

Decisions

  • userId in GET /api/users/{userId}/stores can receive "current" to simplify queries.
  • We implement two distinct tool classes rather than merging them to adhere to the existing Tools/*Tools.cs domain-driven naming pattern in the project.