Add UserStores and StorePickups tools; implement endpoints and update documentation
This commit is contained in:
28
.github/plans/plan-managed-stores-pickups.prompt.md
vendored
Normal file
28
.github/plans/plan-managed-stores-pickups.prompt.md
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
## 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.
|
||||
12
.github/prompts/list-open-slot-requests.prompt.md
vendored
Normal file
12
.github/prompts/list-open-slot-requests.prompt.md
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
agent: 'agent'
|
||||
model: Gemini 3 Flash (Preview) (copilot)
|
||||
tools: [foodsharing-mcp/get_user_stores, foodsharing-mcp/get_store_pickups]
|
||||
description: 'List open slot requests for my managed foodsharing stores'
|
||||
---
|
||||
|
||||
Your goal is to look at all my stores that i manage (isManaging = true), retrieve the pickups and find where the slot's isConfirmed property is false
|
||||
|
||||
tools to use:
|
||||
'Foodsharing Mcp/get_user_stores'
|
||||
'Foodsharing Mcp/get_store_pickups'
|
||||
Reference in New Issue
Block a user