MCPcopy Create free account
hub / github.com/modelcontextprotocol/inspector / getTaskSupport

Function getTaskSupport

client/src/components/ToolsTab.tsx:73–87  ·  view source on GitHub ↗
(
  tool: Tool | null,
)

Source from the content-addressed store, hash-verified

71
72// Returns the execution.taskSupport value for a tool, defaulting to "forbidden" per MCP spec
73const getTaskSupport = (
74 tool: Tool | null,
75): "forbidden" | "required" | "optional" => {
76 if (!tool) return "forbidden";
77 const extendedTool = tool as ExtendedTool;
78 const taskSupport = extendedTool.execution?.taskSupport;
79 if (
80 taskSupport === "forbidden" ||
81 taskSupport === "required" ||
82 taskSupport === "optional"
83 ) {
84 return taskSupport;
85 }
86 return "forbidden";
87};
88
89// Type guard to safely detect the optional annotations field
90const hasAnnotations = (

Callers 1

ToolsTabFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected