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

Function addMcpToolMetadataUsage

apps/sim/lib/mcp/tool-limits.ts:55–72  ·  view source on GitHub ↗
(
  usage: McpToolMetadataUsage,
  tool: {
    toolName?: string | null
    toolDescription?: string | null
    parameterSchema?: unknown
  }
)

Source from the content-addressed store, hash-verified

53}
54
55export function addMcpToolMetadataUsage(
56 usage: McpToolMetadataUsage,
57 tool: {
58 toolName?: string | null
59 toolDescription?: string | null
60 parameterSchema?: unknown
61 }
62): McpToolMetadataUsage {
63 const sizes = getMcpToolMetadataSizes(tool)
64 return {
65 schemaBytes: usage.schemaBytes + sizes.parameterSchemaBytes,
66 metadataBytes:
67 usage.metadataBytes +
68 sizes.toolNameBytes +
69 sizes.toolDescriptionBytes +
70 sizes.parameterSchemaBytes,
71 }
72}
73
74export function addMcpToolMetadataUsageRow(
75 usage: McpToolMetadataUsage,

Calls 1

getMcpToolMetadataSizesFunction · 0.85

Tested by

no test coverage detected