Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds MCP (Model Context Protocol) tool annotations to HTTP tools generated from OpenAPI specifications. The annotations provide REST-aware metadata including title, read-only hints, idempotent hints, and destructive hints based on HTTP verb conventions. A new --no-annotations command line flag allows users to disable this feature.
- Adds REST-aware MCP ToolAnnotations based on HTTP verb conventions (GET=readonly/idempotent, POST=destructive/non-idempotent, etc.)
- Introduces configurable options pattern with
WithoutAnnotations()for disabling annotations - Adds
--no-annotationsCLI flag to provide user control over annotation generation
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| internal/openapi.go | Adds ToolAnnotations generation logic with options pattern and REST convention mapping |
| cmd/emcee/main.go | Adds CLI flag and option passing to disable annotations |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| title = fmt.Sprintf("%s %s", op.method, p) | ||
| } | ||
| openWorld := true | ||
| destructiveTrue := true |
There was a problem hiding this comment.
[nitpick] The variable destructiveTrue is defined but only used for POST, PUT, PATCH, and DELETE cases. Consider defining it only where needed or use a literal true directly in the assignments to reduce unnecessary variable declarations.
| destructiveTrue := true |
See https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations
This PR adds tool annotations based on REST conventions for HTTP verbs in the OpenAPI schema.
This is enabled by default, and can be disabled with the
--no-annotationsoption.