feat(client): add MCP spec descriptions to annotation tooltips
Enhance tooltips to include descriptions from the MCP specification: - Read-only: Tool does not modify its environment - Destructive: Tool may perform destructive updates (delete/overwrite data) - Idempotent: Calling repeatedly with same args has no additional effect - Open-world: Tool may interact with external entities beyond its local environment Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
dad17c6cc2
commit
1cadda06c0
1 changed files with 9 additions and 6 deletions
|
|
@ -85,39 +85,42 @@ const AnnotationBadges = ({
|
||||||
const idempotent = getValueAndImplied(annotations?.idempotentHint, false);
|
const idempotent = getValueAndImplied(annotations?.idempotentHint, false);
|
||||||
const openWorld = getValueAndImplied(annotations?.openWorldHint, true);
|
const openWorld = getValueAndImplied(annotations?.openWorldHint, true);
|
||||||
|
|
||||||
|
// Descriptions from MCP spec
|
||||||
const badges = [
|
const badges = [
|
||||||
{
|
{
|
||||||
label: "Read-only",
|
label: "Read-only",
|
||||||
value: readOnly.value,
|
value: readOnly.value,
|
||||||
implied: readOnly.implied,
|
implied: readOnly.implied,
|
||||||
|
description: "Tool does not modify its environment",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Destructive",
|
label: "Destructive",
|
||||||
value: destructive.value,
|
value: destructive.value,
|
||||||
implied: destructive.implied,
|
implied: destructive.implied,
|
||||||
|
description:
|
||||||
|
"Tool may perform destructive updates (delete/overwrite data)",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Idempotent",
|
label: "Idempotent",
|
||||||
value: idempotent.value,
|
value: idempotent.value,
|
||||||
implied: idempotent.implied,
|
implied: idempotent.implied,
|
||||||
|
description: "Calling repeatedly with same args has no additional effect",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Open-world",
|
label: "Open-world",
|
||||||
value: openWorld.value,
|
value: openWorld.value,
|
||||||
implied: openWorld.implied,
|
implied: openWorld.implied,
|
||||||
|
description:
|
||||||
|
"Tool may interact with external entities beyond its local environment",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-wrap gap-1 mt-2">
|
<div className="flex flex-wrap gap-1 mt-2">
|
||||||
{badges.map(({ label, value, implied }) => (
|
{badges.map(({ label, value, implied, description }) => (
|
||||||
<span
|
<span
|
||||||
key={label}
|
key={label}
|
||||||
title={
|
title={`${description}\n\nValue: ${value ? "Yes" : "No"} (${implied ? "implied default" : "explicitly set"})`}
|
||||||
implied
|
|
||||||
? `${value ? "Yes" : "No"} (implied default)`
|
|
||||||
: `${value ? "Yes" : "No"} (explicitly set)`
|
|
||||||
}
|
|
||||||
className={cn(
|
className={cn(
|
||||||
"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium border",
|
"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium border",
|
||||||
implied && "border-dashed opacity-60",
|
implied && "border-dashed opacity-60",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue