MCPcopy Index your code
hub / github.com/simstudioai/sim / getMcpToolIssue

Function getMcpToolIssue

apps/sim/lib/mcp/tool-validation.ts:69–91  ·  view source on GitHub ↗
(
  storedTool: StoredMcpToolReference,
  servers: ServerState[],
  discoveredTools: DiscoveredTool[]
)

Source from the content-addressed store, hash-verified

67}
68
69export function getMcpToolIssue(
70 storedTool: StoredMcpToolReference,
71 servers: ServerState[],
72 discoveredTools: DiscoveredTool[]
73): McpToolIssue | null {
74 const { serverId, serverUrl, toolName, schema } = storedTool
75
76 const serverIssue = getMcpServerIssue(serverId, serverUrl, servers)
77 if (serverIssue) return serverIssue
78
79 const serverTool = discoveredTools.find((t) => t.serverId === serverId && t.name === toolName)
80 if (!serverTool) {
81 return { type: 'tool_not_found', message: 'Tool not found on server' }
82 }
83
84 if (schema && serverTool.inputSchema) {
85 if (hasSchemaChanged(schema, serverTool.inputSchema)) {
86 return { type: 'schema_changed', message: 'Tool schema changed' }
87 }
88 }
89
90 return null
91}
92
93export function getIssueBadgeLabel(issue: McpToolIssue): string {
94 switch (issue.type) {

Callers 3

getStoredToolIssuesFunction · 0.90
tool-input.tsxFile · 0.90

Calls 2

getMcpServerIssueFunction · 0.85
hasSchemaChangedFunction · 0.85

Tested by

no test coverage detected