Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): all MCP tools now send compact schemas, cutting tool context by 23% #25790

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/25790/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 3 changed files with 47 additions and 2 deletions.

x
0 of 3 viewed, 3 left
14 additions and 0 deletionsapps/server/src/mcp/McpHttpServer.test.tsModified
View file
@@ -21,6 +21,7 @@
import * as ProjectService from "../project/ProjectService.ts";
import * as PullRequestReviewGuideService from "../pullRequest/PullRequestReviewGuideService.ts";
import * as ServerConfig from "../config.ts";
+import { advertisedJsonSchema } from "./advertisedJsonSchema.ts";
import * as McpHttpServer from "./McpHttpServer.ts";
import * as McpToolAccess from "./McpToolAccess.ts";
import * as McpToolAccessTestkit from "./McpToolAccess.testkit.ts";
@@ -29,6 +30,7 @@
import * as OrchestratorMcpService from "./OrchestratorMcpService.ts";
import * as PreviewAutomationBroker from "./PreviewAutomationBroker.ts";
import { OrchestratorToolkit } from "./toolkits/orchestrator/tools.ts";
+import { PreviewToolkit } from "./toolkits/preview/tools.ts";
import { ProjectToolkit } from "./toolkits/project/tools.ts";
​
const environmentId = EnvironmentId.make("environment-mcp-test");
@@ -356,6 +358,18 @@
}).pipe(Effect.provide(layerTest)),
​
+it.effect("advertises the compact input schema for every registered tool", () =>
+ Effect.gen(function* () {
+ const server = yield* McpServer.McpServer;
+ const tools: Record<string, Tool.Any> = PreviewToolkit.tools;
+​
+ expect(server.tools.length).toBe(Object.keys(tools).length);
+ for (const { tool } of server.tools) {
+ expect(tool.inputSchema, tool.name).toEqual(advertisedJsonSchema(tools[tool.name]!));