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

Function getMcpServerIssue

apps/sim/lib/mcp/tool-validation.ts:45–67  ·  view source on GitHub ↗
(
  serverId: string,
  serverUrl: string | undefined,
  servers: ServerState[]
)

Source from the content-addressed store, hash-verified

43 * Checks: server existence, connection status, URL changes.
44 */
45export function getMcpServerIssue(
46 serverId: string,
47 serverUrl: string | undefined,
48 servers: ServerState[]
49): McpToolIssue | null {
50 const server = servers.find((s) => s.id === serverId)
51 if (!server) {
52 return { type: 'server_not_found', message: 'Server not found' }
53 }
54
55 if (server.connectionStatus === 'error') {
56 return { type: 'server_error', message: server.lastError || 'Server connection error' }
57 }
58 if (server.connectionStatus !== 'connected') {
59 return { type: 'server_error', message: 'Server not connected' }
60 }
61
62 if (serverUrl && server.url && serverUrl !== server.url) {
63 return { type: 'url_changed', message: 'Server URL changed' }
64 }
65
66 return null
67}
68
69export function getMcpToolIssue(
70 storedTool: StoredMcpToolReference,

Callers 1

getMcpToolIssueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected