feat(everything): add tool-level annotations to get-annotated-message
Add readOnlyHint, destructiveHint, idempotentHint, and openWorldHint annotations to the tool config. Update docs to reflect that this tool now demonstrates both tool-level and content annotations. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
861c11b786
commit
c743a10da0
2 changed files with 7 additions and 1 deletions
|
|
@ -129,7 +129,7 @@ src/everything
|
||||||
- `echo.ts`
|
- `echo.ts`
|
||||||
- Registers an `echo` tool that takes a message and returns `Echo: {message}`.
|
- Registers an `echo` tool that takes a message and returns `Echo: {message}`.
|
||||||
- `get-annotated-message.ts`
|
- `get-annotated-message.ts`
|
||||||
- Registers an `annotated-message` tool which demonstrates annotated content items by emitting a primary `text` message with `annotations` that vary by `messageType` (`"error" | "success" | "debug"`), and optionally includes an annotated `image` (tiny PNG) when `includeImage` is true.
|
- Registers an `annotated-message` tool which demonstrates both tool-level annotations (`readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`) and content annotations. Emits a primary `text` message with content `annotations` (`priority`, `audience`) that vary by `messageType` (`"error" | "success" | "debug"`), and optionally includes an annotated `image` (tiny PNG) when `includeImage` is true.
|
||||||
- `get-env.ts`
|
- `get-env.ts`
|
||||||
- Registers a `get-env` tool that returns the current process environment variables as formatted JSON text; useful for debugging configuration.
|
- Registers a `get-env` tool that returns the current process environment variables as formatted JSON text; useful for debugging configuration.
|
||||||
- `get-resource-links.ts`
|
- `get-resource-links.ts`
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,12 @@ const config = {
|
||||||
description:
|
description:
|
||||||
"Demonstrates how annotations can be used to provide metadata about content.",
|
"Demonstrates how annotations can be used to provide metadata about content.",
|
||||||
inputSchema: GetAnnotatedMessageSchema,
|
inputSchema: GetAnnotatedMessageSchema,
|
||||||
|
annotations: {
|
||||||
|
readOnlyHint: true, // This tool only returns data, no side effects
|
||||||
|
destructiveHint: false, // Does not delete or modify anything
|
||||||
|
idempotentHint: true, // Same input always produces same output
|
||||||
|
openWorldHint: false, // Does not interact with external systems
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue