Skip to main content

Function: checkMcpSurface()

checkMcpSurface(__namedParameters): McpSurfaceViolation[]

Defined in: mcpSurface.ts:139

Every limit an MCP surface exceeds, or [] when it fits.

Returns rather than throws, so a test's expect(...).toEqual([]) prints which tool went over and by how much. Meant for a test, not for boot: a server refusing to start over a few hundred bytes is worse than a red test.

Parameters​

ParameterType
__namedParameters{ budget?: McpSurfaceBudget; instructions?: string; tools: McpSurfaceTool[]; }
__namedParameters.budget?McpSurfaceBudget
__namedParameters.instructions?string
__namedParameters.toolsMcpSurfaceTool[]

Returns​

McpSurfaceViolation[]

Example​

expect(
checkMcpSurface({
tools,
instructions,
budget: { total: 70_000, perTool: 10_000 },
})
).toEqual([]);