@tokenlabai/mcp-server 0.6.18 → 0.6.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/contract/openapi.json +17 -0
- package/generated/public-contract.json +3 -3
- package/generated/tools.json +1 -1
- package/package.json +1 -1
- package/src/index.js +8 -3
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ It exposes public catalog tools for agents that need to choose models, inspect s
|
|
|
10
10
|
|
|
11
11
|
## Generated Tool Profiles
|
|
12
12
|
|
|
13
|
-
The checked-in `generated/tools.json` manifest is generated from TokenLab's public OpenAPI document plus the small MCP-only overlay in `contract/mcp-overlay.json`. Version 0.6.
|
|
13
|
+
The checked-in `generated/tools.json` manifest is generated from TokenLab's public OpenAPI document plus the small MCP-only overlay in `contract/mcp-overlay.json`. Version 0.6.20 generates 78 endpoint tools; with the two MCP-only composite discovery tools, the full profile returns 80 tools from `tools/list`.
|
|
14
14
|
|
|
15
15
|
| Profile | Endpoint tools | Total registered tools | Model-facing schema | Coverage |
|
|
16
16
|
| --- | ---: | ---: | --- | --- |
|
|
@@ -29,6 +29,7 @@ The smaller [`generated/public-contract.json`](./generated/public-contract.json)
|
|
|
29
29
|
## Native MCP Features
|
|
30
30
|
|
|
31
31
|
- JSON tool responses include `structuredContent` while retaining serialized text for older clients.
|
|
32
|
+
- HTTP errors retain the original response text (up to 4,000 characters), including public correction hints, alongside structured status, request ID and retry timing. Only the request ID and retry headers are exposed; failed generation requests are never submitted again automatically.
|
|
32
33
|
- Generated tools expose human-readable titles, standard read-only/destructive/idempotent/open-world annotations, and response request IDs when available.
|
|
33
34
|
- Tool schemas are published and validated directly as JSON Schema. The runtime does not round-trip generated tool schemas through Zod; `exact` mode is byte-shape equivalent to the generated canonical schema.
|
|
34
35
|
- Three resources expose the live API overview, the package's OpenAPI snapshot, and the compact MCP public contract.
|
|
@@ -133,7 +134,7 @@ This repository includes `server.json` for the official MCP Registry.
|
|
|
133
134
|
|
|
134
135
|
Release metadata:
|
|
135
136
|
|
|
136
|
-
- npm package: `@tokenlabai/mcp-server@0.6.
|
|
137
|
+
- npm package: `@tokenlabai/mcp-server@0.6.20`
|
|
137
138
|
- MCP registry name: `io.github.hedging8563/tokenlab`
|
|
138
139
|
- `package.json.mcpName`: `io.github.hedging8563/tokenlab`
|
|
139
140
|
|
package/contract/openapi.json
CHANGED
|
@@ -3626,6 +3626,23 @@
|
|
|
3626
3626
|
},
|
|
3627
3627
|
"404": {
|
|
3628
3628
|
"$ref": "#/components/responses/NotFound"
|
|
3629
|
+
},
|
|
3630
|
+
"409": {
|
|
3631
|
+
"description": "A revoked API key cannot be reactivated. Create a new key.",
|
|
3632
|
+
"content": {
|
|
3633
|
+
"application/json": {
|
|
3634
|
+
"schema": {
|
|
3635
|
+
"$ref": "#/components/schemas/ApiError"
|
|
3636
|
+
},
|
|
3637
|
+
"example": {
|
|
3638
|
+
"error": {
|
|
3639
|
+
"message": "A revoked API key cannot be reactivated. Create a new key.",
|
|
3640
|
+
"type": "invalid_request_error",
|
|
3641
|
+
"code": "api_key_revoked"
|
|
3642
|
+
}
|
|
3643
|
+
}
|
|
3644
|
+
}
|
|
3645
|
+
}
|
|
3629
3646
|
}
|
|
3630
3647
|
},
|
|
3631
3648
|
"x-mint": {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"id": "tokenlab-mcp-server",
|
|
6
6
|
"name": "@tokenlabai/mcp-server",
|
|
7
7
|
"title": "TokenLab MCP Server",
|
|
8
|
-
"version": "0.6.
|
|
8
|
+
"version": "0.6.20",
|
|
9
9
|
"registry_name": "io.github.hedging8563/tokenlab",
|
|
10
10
|
"source_url": "https://github.com/hedging8563/tokenlab-mcp-server",
|
|
11
11
|
"landing_url": "https://tokenlab.sh/mcp",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"openapi": "3.1.0",
|
|
27
27
|
"title": "TokenLab AI Gateway",
|
|
28
28
|
"version": "1.0.0",
|
|
29
|
-
"sha256": "
|
|
30
|
-
"tool_manifest_sha256": "
|
|
29
|
+
"sha256": "1d9af059901343fbbf6ddb7522e8931fe014400febd41c8108a008c649d8f188",
|
|
30
|
+
"tool_manifest_sha256": "eb230a4cc9f3b8f424314f29a5dce68b82085ac88d1e63845032be35214b9fdc"
|
|
31
31
|
},
|
|
32
32
|
"profiles": {
|
|
33
33
|
"catalog": {
|
package/generated/tools.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"openapi": "3.1.0",
|
|
7
7
|
"title": "TokenLab AI Gateway",
|
|
8
8
|
"version": "1.0.0",
|
|
9
|
-
"sha256": "
|
|
9
|
+
"sha256": "1d9af059901343fbbf6ddb7522e8931fe014400febd41c8108a008c649d8f188"
|
|
10
10
|
},
|
|
11
11
|
"default_profile": "core",
|
|
12
12
|
"profiles": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenlabai/mcp-server",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.20",
|
|
4
4
|
"description": "OpenAPI-generated TokenLab MCP server with 31 default and 80 full-profile tools for catalog, native AI, multimodal, and async APIs.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
package/src/index.js
CHANGED
|
@@ -273,7 +273,7 @@ class TokenLabHttpError extends Error {
|
|
|
273
273
|
?? retryAfterSeconds(apiError?.retry_after ?? body?.retry_after);
|
|
274
274
|
const declaredRetryable = apiError?.retryable ?? body?.retryable;
|
|
275
275
|
const message = boundedText(apiError?.message) || boundedText(text) || response.statusText;
|
|
276
|
-
super(`TokenLab request failed: ${response.status} ${response.statusText}${requestId ? ` (request ${requestId})` : ""}\n${message}`);
|
|
276
|
+
super(`TokenLab request failed: ${response.status} ${response.statusText}${requestId ? ` (request ${requestId})` : ""}\n${boundedText(text) || message}`);
|
|
277
277
|
this.name = "TokenLabHttpError";
|
|
278
278
|
this.details = definedValues({
|
|
279
279
|
status: response.status,
|
|
@@ -384,7 +384,7 @@ async function compareModels({ models, include_raw }) {
|
|
|
384
384
|
const [details, pricing] = await Promise.all([
|
|
385
385
|
executePublicJson(`/v1/models/${encoded}`),
|
|
386
386
|
executePublicJson(`/v1/models/${encoded}/pricing`).catch((error) => (
|
|
387
|
-
error instanceof TokenLabHttpError ? error.details : { error: error.message }
|
|
387
|
+
error instanceof TokenLabHttpError ? { ...error.details, diagnostic: error.message } : { error: error.message }
|
|
388
388
|
))
|
|
389
389
|
]);
|
|
390
390
|
if (include_raw) return { model, details, pricing };
|
|
@@ -498,7 +498,12 @@ const registeredToolsByName = new Map(registeredTools.map((tool) => [
|
|
|
498
498
|
|
|
499
499
|
function toolExecutionError(error) {
|
|
500
500
|
if (error instanceof TokenLabHttpError) {
|
|
501
|
-
return {
|
|
501
|
+
return {
|
|
502
|
+
content: [{ type: "text", text: error.message }],
|
|
503
|
+
structuredContent: error.details,
|
|
504
|
+
_meta: error.meta,
|
|
505
|
+
isError: true
|
|
506
|
+
};
|
|
502
507
|
}
|
|
503
508
|
return {
|
|
504
509
|
content: [{
|