Skip to content

Commit 9130496

Browse files
cliffhallclaude
andcommitted
chore(everything): fix misleading names in get-resource-links and two JSDoc headers
Rename get-resource-links' isOdd flag (true for even IDs) to isText, document the even/odd to Text/Blob mapping, and make the JSDoc headers of get-resource-links and trigger-long-running-operation name the tool their file registers. Closes #5210 Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: cliffhall <[email protected]>
1 parent 5a5aa85 commit 9130496

4 files changed

Lines changed: 14 additions & 9 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@modelcontextprotocol/server-everything": patch
3+
---
4+
5+
`get-resource-links`: rename the misleading `isOdd` flag to `isText`, and say in its JSDoc and in `docs/features.md` that even IDs are Text resources and odd IDs are Blob resources. The JSDoc headers of `get-resource-links` and `trigger-long-running-operation` now name the tool their file registers. No behavior change.

‎src/everything/docs/features.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Each feature below is marked **both**, **2026-07-28** or **2025-era**. Roots, sa
3333
- `get-annotated-message` (tools/get-annotated-message.ts), **both**: Returns a `text` message annotated with `priority` and `audience` based on `messageType` (`error`, `success`, or `debug`); can optionally include an annotated `image`.
3434
- `get-env` (tools/get-env.ts), **both**: Returns all environment variables from the running process as pretty-printed JSON text. Every name is returned, but the value of a credential-like name (one with a `KEY`, `TOKEN`, `SECRET`, `PASSWORD`, `PASSWD`, `CREDENTIAL`, `AUTH` or `COOKIE` segment between underscores, in any case) is replaced with `"<redacted>"`. Set `GET_ENV_INCLUDE_SECRETS=1` (or `true`) in the server's environment to return every value unmasked, for debugging.
3535
- `get-header-params` (tools/get-header-params.ts), **both**: Returns its `region` argument and the `Mcp-Param-Region` HTTP header it arrived in. Its input and output schemas are plain JSON Schema 2020-12, and `region` carries `x-mcp-header: "Region"`, so a 2026-07-28 Streamable HTTP client mirrors it into that header and the server refuses a call whose header disagrees with the body (`-32020`). The header is `null` on stdio and for a 2025-era client.
36-
- `get-resource-links` (tools/get-resource-links.ts), **both**: Returns an intro `text` block followed by multiple `resource_link` items. For a requested `count` (1–10), alternates between dynamic Text and Blob resources using URIs from `resources/templates.ts`.
36+
- `get-resource-links` (tools/get-resource-links.ts), **both**: Returns an intro `text` block followed by multiple `resource_link` items. For a requested `count` (1–10), alternates between dynamic Text resources (even IDs) and Blob resources (odd IDs), using URIs from `resources/templates.ts`.
3737
- `get-resource-reference` (tools/get-resource-reference.ts), **both**: Accepts `resourceType` (`text` or `blob`) and `resourceId` (positive integer). Returns a concrete `resource` content block (with its `uri`, `mimeType`, and data) with surrounding explanatory `text`.
3838
- `get-roots-list` (tools/get-roots-list.ts), **both**, deprecated: Asks the client for its roots with a multi-round-trip request (`inputRequired.listRoots()`) and lists them. Needs client capability `roots`.
3939
- `gzip-file-as-resource` (tools/gzip-file-as-resource.ts), **both**: Accepts a `name` and `data` (URL or data URI), fetches the data subject to size/time/domain constraints, compresses it, and returns either a `resource_link` (default) or an inline `resource` depending on `outputType`, with `mimeType: application/gzip`. The linked resource is registered as a session resource at `demo://resource/session/<name>` for a 2025-era client, and stored for ten minutes at a minted `demo://resource/minted/<id>/<name>` for a 2026-07-28 client.

‎src/everything/tools/get-resource-links.ts‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ const config = {
3333
};
3434

3535
/**
36-
* Registers the 'get-resource-reference' tool.
36+
* Registers the 'get-resource-links' tool.
3737
*
3838
* The registered tool retrieves a specified number of resource links and their metadata.
3939
* Resource links are dynamically generated as either text or binary blob resources,
40-
* based on their ID being even or odd.
40+
* based on their ID: even IDs are text resources, odd IDs are blob resources.
4141
4242
* The response contains a "text" introductory block and multiple "resource_link" blocks.
4343
*
@@ -56,21 +56,21 @@ export const registerGetResourceLinksTool = (server: McpServer) => {
5656

5757
// Create resource link content blocks
5858
for (let resourceId = 1; resourceId <= count; resourceId++) {
59-
// Get resource uri for text or blob resource based on odd/even resourceId
60-
const isOdd = resourceId % 2 === 0;
61-
const uri = isOdd
59+
// Even resourceIds are text resources, odd ones are blob resources
60+
const isText = resourceId % 2 === 0;
61+
const uri = isText
6262
? textResourceUri(resourceId)
6363
: blobResourceUri(resourceId);
6464

6565
// Get resource based on the resource type
66-
const resource = isOdd
66+
const resource = isText
6767
? textResource(uri, resourceId)
6868
: blobResource(uri, resourceId);
6969

7070
content.push({
7171
type: "resource_link",
7272
uri: resource.uri,
73-
name: `${isOdd ? "Text" : "Blob"} Resource ${resourceId}`,
73+
name: `${isText ? "Text" : "Blob"} Resource ${resourceId}`,
7474
description: `Resource ${resourceId}: ${
7575
resource.mimeType === "text/plain"
7676
? "plaintext resource"

‎src/everything/tools/trigger-long-running-operation.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const config = {
2525
};
2626

2727
/**
28-
* Registers the 'trigger-tong-running-operation' tool.
28+
* Registers the 'trigger-long-running-operation' tool.
2929
*
3030
* The registered tool starts a long-running operation defined by a specific duration and
3131
* number of steps.

0 commit comments

Comments
 (0)