feat(mcp): add list_places filter, tool annotations, prompts, and bug fixes#474
Closed
Ivan-Malinovski wants to merge 10 commits into
Closed
feat(mcp): add list_places filter, tool annotations, prompts, and bug fixes#474Ivan-Malinovski wants to merge 10 commits into
Ivan-Malinovski wants to merge 10 commits into
Conversation
- Add tool annotations (readOnlyHint, destructiveHint, idempotentHint, openWorldHint) to all 40+ tools - Register 3 MCP prompts: trip-summary, packing-list, budget-overview - Add explicit mimeType: application/json to all resource registrations - Announce capabilities with listChanged on resources, tools, prompts - Update server name to 'TREK MCP' in MCP initialization
…rs crashing tools
2 tasks
Owner
|
Manual approved today |
Collaborator
|
I had some minor improvements to do, closing this pr in favor for #535 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a new
list_placestool with assignment filtering, adds tool annotations to all MCP tools, improves tool descriptions, and fixes several pre-existing bugs discovered during testing.This PR was motivated by the need to bring TREK's MCP implementation in line with MCP best practices — specifically adding tool annotations so LLM clients can understand read/write semantics before making tool calls.
MCP Best Practices Compliance
Tool annotations
All 35+ tools now have proper
readOnlyHint,destructiveHint,idempotentHint, andopenWorldHintannotations:TOOL_ANNOTATIONS_READONLY):list_trips,list_places,get_trip_summary,list_categories,search_place, etc.TOOL_ANNOTATIONS_WRITE):update_trip,update_place,update_day,update_reservation, etc.TOOL_ANNOTATIONS_DELETE):delete_trip,delete_place,delete_budget_item, etc. (destructiveHint: true)TOOL_ANNOTATIONS_NON_IDEMPOTENT):create_place,create_trip,create_reservation, etc. (create = non-idempotent)Impact: LLM clients like Perplexity can now make safer, informed decisions about tool usage without guessing or trying to reason through side effects.
MCP Prompts
3 prompts registered for structured LLM workflows:
trip-summary— loads full trip context before planningpacking-list— formatted packing checklist grouped by categorybudget-overview— formatted budget summary with category breakdownResources
All 16 resources now have explicit
mimeType: 'application/json'declarations.Capabilities
Server announces
listChanged: truefor resources, tools, and prompts — informing clients when the tool set changes.New Feature
list_placestool with assignment filterA new MCP tool for listing places filtered by whether they're scheduled on a day:
End-user impact: LLMs can now discover orphan (unassigned) activities in a trip — "Which places haven't been scheduled yet?" — enabling better travel planning workflows without manual inspection.
Also available via the
trek://trips/{tripId}/placesresource with?assignment=unassignedquery param.Tool Quality Improvements
Enum descriptions
All
z.enumfields now have explicit.describe()annotations so LLMs see valid options without guessing:assignment—"all","unassigned","assigned"create_reservation.type— 10 reservation typesupdate_reservation.type— same 10 typesupdate_reservation.status—"pending","confirmed","cancelled"Error handling
broadcast()calls wrapped insafeBroadcast()to prevent WebSocket errors from crashing tool handlersBug Fixes
safeBroadcastrecursive bug; streaming requests no longer crash the MCPupdate_placemissing fieldscategory_id,osm_id,price,currency,place_time,end_time,duration_minutes,transport_modenot in tool schemacreate_collab_noteignorespinnedpinned: truesilently ignoredpinnedtocreateNoteservice INSERT and tool schemaosm_idsilently ignored on updateosm_idosm_idto UPDATE statement and tool schemaPre-existing Bugs Confirmed Working
create_place,update_place,list_places,get_trip_summary,list_trips,list_categories,search_place,assign_place_to_day,delete_place— all verified workingcreate_budget_item,create_packing_item,create_reservation— working (were failing before safeBroadcast fix)Test Results
Commits (10 total)
9510fbaf5777ffd15b83757c0108e7206dca5c7a4952e2f7f7d9455b910159fDisclaimer: Entirely vibe coded with MiniMax M2.7.