Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix: include directory tool annotation titles

Richie McIlroy6457f0535b8a
diff --git a/apps/web/__tests__/unit/mcp-server.test.ts b/apps/web/__tests__/unit/mcp-server.test.ts
index ad91c8842..d396c2c4d 100644
--- a/apps/web/__tests__/unit/mcp-server.test.ts
+++ b/apps/web/__tests__/unit/mcp-server.test.ts
@@ -152,6 +152,31 @@ describe("hosted MCP transport", () => {
expect(listBody).toContain("caps_get");
expect(listBody).toContain("caps_context");
expect(listBody).toContain('"openWorldHint":false');
+ const data = listBody.split("\n").find((line) => line.startsWith("data: "));
+ expect(data).toBeDefined();
+ const tools = JSON.parse(data?.slice(6) ?? "").result.tools;
+ expect(tools).toEqual(
+ expect.arrayContaining([
+ expect.objectContaining({
+ name: "caps_list",
+ annotations: expect.objectContaining({
+ title: "List Cap recordings",
+ }),
+ }),
+ expect.objectContaining({
+ name: "caps_get",
+ annotations: expect.objectContaining({
+ title: "Get a Cap recording",
+ }),
+ }),
+ expect.objectContaining({
+ name: "caps_context",
+ annotations: expect.objectContaining({
+ title: "Read a Cap recording",
+ }),
+ }),
+ ]),
+ );
expect(listBody).not.toContain("caps_delete");
const called = await POST(
request({
diff --git a/apps/web/lib/mcp-server.ts b/apps/web/lib/mcp-server.ts
index 16548cf1a..aa96c9fba 100644
--- a/apps/web/lib/mcp-server.ts
+++ b/apps/web/lib/mcp-server.ts
@@ -55,7 +55,7 @@ export const createCapMcpServer = (userId: User.UserId) => {
},
additionalProperties: false,
}),
- annotations: readOnly,
+ annotations: { ...readOnly, title: "List Cap recordings" },
},
async (input) => {
try {
@@ -78,7 +78,7 @@ export const createCapMcpServer = (userId: User.UserId) => {
required: ["id"],
additionalProperties: false,
}),
- annotations: readOnly,
+ annotations: { ...readOnly, title: "Get a Cap recording" },
},
async ({ id }) => {
try {
@@ -106,7 +106,7 @@ export const createCapMcpServer = (userId: User.UserId) => {
required: ["id"],
additionalProperties: false,
}),
- annotations: readOnly,
+ annotations: { ...readOnly, title: "Read a Cap recording" },
_meta: { ui: { resourceUri: cardUri }, "openai/outputTemplate": cardUri },
},
async ({ id, query }) => {