Skip to content

Conversation

@olaservo
Copy link
Member

@olaservo olaservo commented Feb 15, 2025

Description

Adds ANNOTATED_MESSAGE tool example in the everything MCP server to better demonstrate how Annotated can be used with content like messages.

Server Details

  • Server: everything
  • Changes to: tools (adds ANNOTATED_MESSAGE example) and documentation

Motivation and Context

These changes improve the documentation and examples of how to use annotations, making it easier for developers to understand how and when to use annotations. The examples demonstrate both priority levels and audience targeting.

How Has This Been Tested?

I've tested the following scenarios in Inspector using a modified version from this PR: modelcontextprotocol/inspector#150

For messageType, try one of these values:

  • "error" - Will show a high-priority message visible to both user and assistant
  • "success" - Will show a medium-priority message focused on the user
  • "debug" - Will show a low-priority message focused on the assistant

For includeImage:

  • true - Will include the MCP tiny image with medium priority for user visualization
  • false - Will only show the text message

Some example combinations tested, with screenshots:

Test error message:

  • messageType: "error"
  • includeImage: false This will show how high-priority error messages are handled.

annotated_message_1

Test debug with image:

  • messageType: "debug"
  • includeImage: true This will demonstrate both assistant-focused debug info and user-focused image handling.

annotated_message_2

Test success message:

  • messageType: "success"
  • includeImage: false This will show how user-focused success messages are handled.

annotated_message_3

Breaking Changes

No breaking changes. This is an enhancement to existing example code and documentation.

Types of changes

  • Bug fix
  • New feature (enhanced example implementation)
  • Breaking change
  • Documentation update

Checklist

  • I have read the MCP Protocol Documentation
  • My changes follows MCP security best practices
  • I have updated the server's README accordingly
  • I have tested this with an LLM client
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have documented all environment variables and configuration options

@dsp-ant
Copy link
Member

dsp-ant commented Feb 21, 2025

This is great! THank you

@dsp-ant dsp-ant merged commit 0a04d40 into modelcontextprotocol:main Feb 21, 2025
@olaservo olaservo deleted the add-annotation-example branch February 22, 2025 01:27
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.

2 participants