@last-price/tools-mcp 0.1.0 → 0.2.0

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 CHANGED
@@ -36,9 +36,10 @@ Claude Desktop (`claude_desktop_config.json`) and Cursor (`mcp.json`):
36
36
  | `LASTPRICE_JWT` | A JWT instead, sent as `Authorization: Bearer`. |
37
37
  | `LASTPRICE_API_URL` | Default `https://api.last-price.ai`. |
38
38
  | `LASTPRICE_TIMEOUT_MS` | Time limit per tool call. Default `30000`. |
39
- | `LASTPRICE_TOOL_ANNOTATIONS` | `1` adds each tool's MCP `annotations` to `tools/list`: a title and `readOnlyHint`, `destructiveHint`, `idempotentHint` and `openWorldHint`, so your host can ask you before a call that changes or deletes something. Off by default. |
40
39
 
41
- `tools/list` describes every tool, including which need a credential and a claimed workspace. The same tools are
40
+ `tools/list` describes every tool, including which need a credential and a claimed workspace, and gives each one its
41
+ MCP `annotations`: a title and `readOnlyHint`, `destructiveHint`, `idempotentHint` and `openWorldHint`, so your host
42
+ can ask you before a call that changes or deletes something. The same tools are
42
43
  listed in the `@last-price/tools-core` README. The annotations are exported from `@last-price/tools-core` as
43
44
  `LAST_PRICE_TOOL_ANNOTATIONS`, for frameworks that gate tool calls themselves.
44
45
 
package/dist/cli.d.ts CHANGED
@@ -6,6 +6,5 @@
6
6
  * LASTPRICE_JWT a JWT instead of a key
7
7
  * LASTPRICE_API_URL default https://api.last-price.ai
8
8
  * LASTPRICE_TIMEOUT_MS time limit per tool call, default 30000
9
- * LASTPRICE_TOOL_ANNOTATIONS 1 adds each tool's title and behaviour hints to tools/list
10
9
  */
11
10
  export {};
package/dist/cli.js CHANGED
@@ -7,12 +7,10 @@
7
7
  * LASTPRICE_JWT a JWT instead of a key
8
8
  * LASTPRICE_API_URL default https://api.last-price.ai
9
9
  * LASTPRICE_TIMEOUT_MS time limit per tool call, default 30000
10
- * LASTPRICE_TOOL_ANNOTATIONS 1 adds each tool's title and behaviour hints to tools/list
11
10
  */
12
11
  Object.defineProperty(exports, "__esModule", { value: true });
13
12
  const server_1 = require("./server");
14
13
  const client = (0, server_1.clientFromEnv)(process.env);
15
- const options = { annotations: process.env.LASTPRICE_TOOL_ANNOTATIONS === '1' };
16
14
  let buffer = '';
17
15
  function send(message) {
18
16
  process.stdout.write(`${JSON.stringify(message)}\n`);
@@ -26,7 +24,7 @@ async function processLine(line) {
26
24
  send({ jsonrpc: '2.0', id: null, error: { code: -32700, message: 'Parse error' } });
27
25
  return;
28
26
  }
29
- const reply = await (0, server_1.handleMessage)(client, parsed, options);
27
+ const reply = await (0, server_1.handleMessage)(client, parsed);
30
28
  if (reply)
31
29
  send(reply);
32
30
  }
package/dist/server.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { LastPriceClient } from '@last-price/tools-core';
2
2
  /** Matches `version` in package.json (a test holds the two together). */
3
- export declare const SERVER_VERSION = "0.1.0";
3
+ export declare const SERVER_VERSION = "0.2.0";
4
4
  /** MCP protocol revisions this server speaks, newest first. */
5
5
  export declare const SUPPORTED_PROTOCOLS: readonly ["2025-11-25", "2025-06-18", "2025-03-26", "2024-11-05"];
6
6
  export declare const SERVER_INSTRUCTIONS: string;
@@ -30,9 +30,8 @@ export type JsonRpcReply = {
30
30
  */
31
31
  export interface HandleOptions {
32
32
  /**
33
- * Add each tool's MCP `annotations` (title and behaviour hints) to
34
- * `tools/list`. Off unless set; the CLI sets it from
35
- * `LASTPRICE_TOOL_ANNOTATIONS=1`.
33
+ * Each tool's MCP `annotations` (title and behaviour hints) in
34
+ * `tools/list`. On unless set to false.
36
35
  */
37
36
  annotations?: boolean;
38
37
  }
package/dist/server.js CHANGED
@@ -5,7 +5,7 @@ exports.handleMessage = handleMessage;
5
5
  exports.clientFromEnv = clientFromEnv;
6
6
  const tools_core_1 = require("@last-price/tools-core");
7
7
  /** Matches `version` in package.json (a test holds the two together). */
8
- exports.SERVER_VERSION = '0.1.0';
8
+ exports.SERVER_VERSION = '0.2.0';
9
9
  /** MCP protocol revisions this server speaks, newest first. */
10
10
  exports.SUPPORTED_PROTOCOLS = ['2025-11-25', '2025-06-18', '2025-03-26', '2024-11-05'];
11
11
  exports.SERVER_INSTRUCTIONS = 'Last Price: compute and verify prices, and manage your pricing workspace. With no credential only the public ' +
@@ -52,7 +52,8 @@ async function handleMessage(client, message, options = {}) {
52
52
  name: tool.name,
53
53
  description: tool.description,
54
54
  inputSchema: tool.parameters,
55
- ...(options.annotations ? { annotations: tools_core_1.LAST_PRICE_TOOL_ANNOTATIONS[tool.name] } : {}),
55
+ ...(tool.outputSchema ? { outputSchema: tool.outputSchema } : {}),
56
+ ...(options.annotations === false ? {} : { annotations: tools_core_1.LAST_PRICE_TOOL_ANNOTATIONS[tool.name] }),
56
57
  })),
57
58
  },
58
59
  };
@@ -62,18 +63,22 @@ async function handleMessage(client, message, options = {}) {
62
63
  return failure(id, -32602, `Unknown tool: ${String(name)}`);
63
64
  }
64
65
  try {
65
- const result = await (0, tools_core_1.runLastPriceTool)(client, name, args ?? {});
66
+ const result = await (0, tools_core_1.runLastPriceTool)(client, name, args === undefined ? {} : args);
67
+ const text = JSON.stringify(result) ?? 'null';
68
+ const structuredContent = (0, tools_core_1.toolStructuredContent)(name, text);
66
69
  return {
67
70
  jsonrpc: '2.0',
68
71
  id,
69
- result: { content: [{ type: 'text', text: JSON.stringify(result) }], isError: false },
72
+ result: { content: [{ type: 'text', text }], isError: false, ...(structuredContent ? { structuredContent } : {}) },
70
73
  };
71
74
  }
72
75
  catch (error) {
76
+ const text = JSON.stringify((0, tools_core_1.toToolError)(error));
77
+ const structuredContent = (0, tools_core_1.toolStructuredContent)(name, text);
73
78
  return {
74
79
  jsonrpc: '2.0',
75
80
  id,
76
- result: { content: [{ type: 'text', text: JSON.stringify((0, tools_core_1.toToolError)(error)) }], isError: true },
81
+ result: { content: [{ type: 'text', text }], isError: true, ...(structuredContent ? { structuredContent } : {}) },
77
82
  };
78
83
  }
79
84
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@last-price/tools-mcp",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "A stdio MCP server for the Last Price pricing API, runnable with npx.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://last-price.ai",
@@ -46,7 +46,7 @@
46
46
  "provenance": true
47
47
  },
48
48
  "dependencies": {
49
- "@last-price/tools-core": "0.1.0"
49
+ "@last-price/tools-core": "0.2.0"
50
50
  },
51
51
  "scripts": {
52
52
  "build": "rm -rf dist && tsc -p tsconfig.build.json && chmod +x dist/cli.js"