Skip to content

Add annotations property to ToolDef #402

Description

@gadenbuie

The MCP schema recently added support for annotation attached to tool definitions. In ellmer this would be an annotations = class_list property, or possibly a new ToolAnnotations class.

The MCP schema is the best documentation of the annotations type that are broadly:

  • destructiveHint: boolean. If true, the tool may perform destructive updates to its environment. If false, the tool performs only additive updates. Meaningful only when readOnlyHint == false. Default: true.
  • idempotentHint: boolean. If true, calling the tool repeatedly with the same arguments will have no additional effect on its environment. Meaningful only when readOnlyHint == false. Default: false.
  • openWorldHint: boolean. If true, this tool may interact with an "open world" of external entities. If false, the tool's domain of interaction is closed. Example: A web search tool has an open world, while a memory tool does not. Default: true.
  • readOnlyHint: boolean. If true, the tool does not modify its environment. Default: false.
  • title: string. A human-readable title for the tool.

These annotations could be used by shinychat for an interface that displays tool results, requests tool calling consent, etc.

Activity

  1. hadley commented on Apr 1, 2025

    @hadley
    Member

    I'd suggest starting with a list(), that's created by a helper function (like params()). That way we don't have to worry about getting locked into a structure now while still steering folks towards likely correct usage.

  2. self-assigned this
    on Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions