nextbillion-mcp 0.1.3 → 0.1.4
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/dist/tools/types.d.ts +8 -1
- package/dist/tools/types.js +11 -1
- package/dist/tools/types.js.map +1 -1
- package/package.json +1 -1
package/dist/tools/types.d.ts
CHANGED
|
@@ -36,4 +36,11 @@ export interface NbTool<Schema extends z.ZodType = z.ZodType> {
|
|
|
36
36
|
export declare const READ_ONLY: ToolAnnotations;
|
|
37
37
|
export declare class ToolInputError extends Error {
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Build a tool result whose text block carries BOTH a human-readable summary and the
|
|
41
|
+
* complete response as JSON. The MCP spec recommends mirroring structured content
|
|
42
|
+
* into the text block: some hosts (e.g. Claude Desktop) surface only the text to the
|
|
43
|
+
* model, so a summary-only text block made fields such as `access` invisible even
|
|
44
|
+
* though they were present in `structuredContent`.
|
|
45
|
+
*/
|
|
46
|
+
export declare function textResult(summary: string, structuredContent?: Record<string, unknown>): ToolResult;
|
package/dist/tools/types.js
CHANGED
|
@@ -7,7 +7,17 @@ export const READ_ONLY = {
|
|
|
7
7
|
};
|
|
8
8
|
export class ToolInputError extends Error {
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Build a tool result whose text block carries BOTH a human-readable summary and the
|
|
12
|
+
* complete response as JSON. The MCP spec recommends mirroring structured content
|
|
13
|
+
* into the text block: some hosts (e.g. Claude Desktop) surface only the text to the
|
|
14
|
+
* model, so a summary-only text block made fields such as `access` invisible even
|
|
15
|
+
* though they were present in `structuredContent`.
|
|
16
|
+
*/
|
|
17
|
+
export function textResult(summary, structuredContent) {
|
|
18
|
+
const text = structuredContent === undefined
|
|
19
|
+
? summary
|
|
20
|
+
: `${summary}\n\nFull response (JSON):\n${JSON.stringify(structuredContent)}`;
|
|
11
21
|
return { content: [{ type: 'text', text }], structuredContent };
|
|
12
22
|
}
|
|
13
23
|
//# sourceMappingURL=types.js.map
|
package/dist/tools/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/tools/types.ts"],"names":[],"mappings":"AAiCA,kFAAkF;AAClF,MAAM,CAAC,MAAM,SAAS,GAAoB;IACxC,YAAY,EAAE,IAAI;IAClB,eAAe,EAAE,KAAK;IACtB,cAAc,EAAE,IAAI;IACpB,aAAa,EAAE,IAAI;CACpB,CAAC;AAEF,MAAM,OAAO,cAAe,SAAQ,KAAK;CAAG;AAE5C,MAAM,UAAU,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/tools/types.ts"],"names":[],"mappings":"AAiCA,kFAAkF;AAClF,MAAM,CAAC,MAAM,SAAS,GAAoB;IACxC,YAAY,EAAE,IAAI;IAClB,eAAe,EAAE,KAAK;IACtB,cAAc,EAAE,IAAI;IACpB,aAAa,EAAE,IAAI;CACpB,CAAC;AAEF,MAAM,OAAO,cAAe,SAAQ,KAAK;CAAG;AAE5C;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CACxB,OAAe,EACf,iBAA2C;IAE3C,MAAM,IAAI,GACR,iBAAiB,KAAK,SAAS;QAC7B,CAAC,CAAC,OAAO;QACT,CAAC,CAAC,GAAG,OAAO,8BAA8B,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,EAAE,CAAC;IAClF,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,iBAAiB,EAAE,CAAC;AAClE,CAAC"}
|
package/package.json
CHANGED