Skip to content

Commit 7b0c4e7

Browse files
committed
merge: inherit #70 review fixes (raw-target-URL webhook descriptions, registry-safe server.json)
2 parents fd0fa4b + b64aa52 commit 7b0c4e7

4 files changed

Lines changed: 35 additions & 4 deletions

File tree

packages/openapi-codegen/src/codegen.test.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,27 @@ describe('codegen derived annotations', () => {
6767
});
6868
});
6969

70+
it('lets a per-action config override the LLM-visible description (spec text loses)', async () => {
71+
// Pins the mechanism used to fix misleading upstream descriptions (e.g. v2's
72+
// getWebhook/deleteWebhook telling callers to pre-URL-encode the id while the
73+
// runtime already encodes path params).
74+
const output = await codegen({
75+
document,
76+
actions: {
77+
thingDelete: { description: 'Delete a thing by raw id — do NOT URL-encode it.' },
78+
},
79+
});
80+
81+
const chunkFor = (toolName: string) =>
82+
output.split('server.tool(').find((part) => part.trimStart().startsWith(`"${toolName}"`));
83+
84+
// Overridden tool carries the override, not the spec description.
85+
expect(chunkFor('thingDelete')).toContain('Delete a thing by raw id — do NOT URL-encode it.');
86+
expect(chunkFor('thingDelete')).not.toContain('"Delete a thing"');
87+
// Tools without an override keep the spec description.
88+
expect(chunkFor('thingList')).toContain('"List things"');
89+
});
90+
7091
it('lets a per-action config override any derived hint, including to false', async () => {
7192
const output = await codegen({
7293
document,

packages/server/server.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
33
"name": "io.github.taskade/mcp-server",
4-
"description": "Connect Taskade to any AI assistant — 68 tools: projects, tasks, agents, agent chat, signed webhooks, space bundles.",
4+
"description": "Connect Taskade to any AI assistant — 68 tools: projects, tasks, agents, agent chat, webhooks.",
55
"repository": {
66
"url": "https://github.com/taskade/mcp.git",
77
"source": "github"

packages/server/src/constants.v2.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,21 @@ export const HUMANIZED_TASKADE_V2_ACTIONS: Record<TaskadeV2Action, string> = {
4040
};
4141

4242
// Per-action description overrides (fed to the codegen's ActionConfig.description).
43-
// Only needed where the spec's summary omits something the model must know.
43+
// Only needed where the spec's summary omits something the model must know — or,
44+
// for getWebhook/deleteWebhook, actively misleads: the upstream spec says the id is
45+
// the webhook's "URL-encoded target URL", but the generated runtime already applies
46+
// encodeURIComponent to every path param, so a caller that pre-encodes double-encodes
47+
// the id and the lookup fails. The override tells the model to pass the RAW URL.
4448
export const TASKADE_V2_ACTION_DESCRIPTIONS: Partial<Record<TaskadeV2Action, string>> = {
4549
createWebhook:
4650
'Register a signed outbound webhook for one or more Taskade events. ' +
4751
'The response includes the HMAC signing secret exactly ONCE — it cannot be ' +
4852
'retrieved again later, so store it securely (e.g. a secret manager) before ' +
4953
'doing anything else.',
54+
getWebhook:
55+
'Get a webhook subscription by id. Pass the webhook’s raw target URL as `id` ' +
56+
'— do NOT URL-encode it; encoding is applied automatically.',
57+
deleteWebhook:
58+
'Delete a webhook subscription by id. Pass the webhook’s raw target URL as `id` ' +
59+
'— do NOT URL-encode it; encoding is applied automatically.',
5060
};

packages/server/src/tools.v2.generated.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ export const setupToolsV2 = (server: McpServer, opts: OpenAPIToolRuntimeConfigOp
405405
);
406406
server.tool(
407407
'getWebhook',
408-
'Get one registered outbound webhook by id (its URL-encoded target URL)',
408+
'Get a webhook subscription by id. Pass the webhook’s raw target URL as `id` — do NOT URL-encode it; encoding is applied automatically.',
409409
z.object({ id: z.string().min(1) }).shape,
410410
{
411411
readOnlyHint: true,
@@ -427,7 +427,7 @@ export const setupToolsV2 = (server: McpServer, opts: OpenAPIToolRuntimeConfigOp
427427
);
428428
server.tool(
429429
'deleteWebhook',
430-
'Delete a registered outbound webhook by id (its URL-encoded target URL)',
430+
'Delete a webhook subscription by id. Pass the webhook’s raw target URL as `id` — do NOT URL-encode it; encoding is applied automatically.',
431431
z.object({ id: z.string().min(1) }).shape,
432432
{
433433
readOnlyHint: false,

0 commit comments

Comments
 (0)