2.3 KiB
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
- Analyze API Models: Extract the response schemas for both endpoints from
fsopenapi.jsonto create fully typed C#recordresponses (e.g.,StoreTeamMembershipWithPickupStatusand theoccupiedSlotsstructure). - Update Endpoints list: Add
GetStoresOfUserandListPickupsForStorerelative URLs toFsMcp/Endpoints.cs. - Implement User Stores Tool (parallel with step 4): Create
FsMcp/Tools/UserStoresTools.csexposing a tool to callGET /api/users/{userId}/stores. EnsureEnsureLoginAsync()is called before making requests, and fully apply[Description]attributes to fields. - Implement Store Pickups Tool (parallel with step 3): Create
FsMcp/Tools/StorePickupsTools.csexposing a tool to callGET /api/stores/{storeId}/pickups. Include theoccupiedSlotswith theirisConfirmedproperty. - Register MCP Tools: Add
.WithTools<UserStoresTools>()and.WithTools<StorePickupsTools>()insideFsMcp/Program.cs. - Update Documents: Add usage instructions, auth behaviors, and endpoint mappings to
FsMcp/README.md.
Relevant files
fsopenapi.json— Source of truth for OpenAPI schema propertiesFsMcp/Endpoints.cs— Add static endpoint URLsFsMcp/Tools/UserStoresTools.cs— ImplementsGET /api/users/{userId}/storesFsMcp/Tools/StorePickupsTools.cs— ImplementsGET /api/stores/{storeId}/pickupsFsMcp/Program.cs— Tool registrationFsMcp/README.md— Documentation
Verification
- Execute
dotnet build FsMcp/FsMcp.csproj -c Debugto verify compilation. - Launch the MCP server using the provided workspace task:
Run FsMcp Debug. - 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
userIdinGET /api/users/{userId}/storescan receive"current"to simplify queries.- We implement two distinct tool classes rather than merging them to adhere to the existing
Tools/*Tools.csdomain-driven naming pattern in the project.