Skip to content

Conversation

mattt
Copy link
Owner

@mattt mattt commented Aug 14, 2025

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-annotations option.

@mattt mattt requested a review from Copilot August 14, 2025 16:54
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-annotations CLI 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
Copy link
Preview

Copilot AI Aug 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Suggested change
destructiveTrue := true

Copilot uses AI. Check for mistakes.

@mattt mattt merged commit 800a61a into main Aug 14, 2025
1 check passed
@mattt mattt deleted the mattt/tool-annotations branch August 14, 2025 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant