@svgrid/mcp 3.0.22 → 3.0.24
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 +9 -0
- package/dist/core-tools.d.ts +1 -66
- package/dist/core-tools.js +1 -65
- package/dist/data.js +6 -6
- package/dist/index.js +106 -33
- package/dist/preview.d.ts +2 -49
- package/dist/preview.js +3 -32
- package/dist/tool-defs.d.ts +122 -0
- package/dist/tool-defs.js +104 -0
- package/package.json +12 -4
- package/server.json +2 -2
package/README.md
CHANGED
|
@@ -102,6 +102,15 @@ The `studio_*` tools let an agent build and edit the **same validated project mo
|
|
|
102
102
|
server's env. Tools that need a licence to be useful should not cost every
|
|
103
103
|
other user context on every request.
|
|
104
104
|
|
|
105
|
+
These tools and `svgrid_scaffold` run on `@svgrid/enterprise`, an optional
|
|
106
|
+
peer that `npx -y @svgrid/mcp` does not install (it would double the cold
|
|
107
|
+
start). Install both in the project and run the local server:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
npm i -D @svgrid/mcp @svgrid/enterprise
|
|
111
|
+
claude mcp add svgrid -- npx svgrid-mcp
|
|
112
|
+
```
|
|
113
|
+
|
|
105
114
|
| Tool | Purpose |
|
|
106
115
|
| --- | --- |
|
|
107
116
|
| `studio_project` | `new`, `load`, `describe`, `config`, `capabilities`. |
|
package/dist/core-tools.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { CORE_TOOLS } from './tool-defs.js';
|
|
1
2
|
export type ToolResult = {
|
|
2
3
|
isError?: boolean;
|
|
3
4
|
content: {
|
|
@@ -5,70 +6,4 @@ export type ToolResult = {
|
|
|
5
6
|
text: string;
|
|
6
7
|
}[];
|
|
7
8
|
};
|
|
8
|
-
export declare const CORE_TOOLS: readonly [{
|
|
9
|
-
readonly name: "svgrid_search";
|
|
10
|
-
readonly title: "Search SvGrid";
|
|
11
|
-
readonly description: "Search SvGrid docs, example demos and the API surface in ONE call. Start here for any \"how do I ...\" question - it covers all three, so you do not have to guess which one holds the answer. Call with no arguments for an index of doc sections, demo categories and API groups. Returns ids/slugs you can pass to svgrid_get.";
|
|
12
|
-
readonly inputSchema: {
|
|
13
|
-
readonly type: "object";
|
|
14
|
-
readonly properties: {
|
|
15
|
-
readonly query: {
|
|
16
|
-
readonly type: "string";
|
|
17
|
-
readonly description: "What you are trying to do, e.g. \"pin a column\", \"server side pagination\", \"kanban swimlanes\". Omit for the index.";
|
|
18
|
-
};
|
|
19
|
-
readonly kind: {
|
|
20
|
-
readonly type: "string";
|
|
21
|
-
readonly enum: readonly ["all", "docs", "examples", "api"];
|
|
22
|
-
readonly description: "Restrict the search. Default \"all\".";
|
|
23
|
-
readonly default: "all";
|
|
24
|
-
};
|
|
25
|
-
readonly detail: {
|
|
26
|
-
readonly type: "string";
|
|
27
|
-
readonly enum: readonly ["concise", "full"];
|
|
28
|
-
readonly description: "\"concise\" (default) returns titles plus a short excerpt. \"full\" returns the matching doc excerpts at length - more tokens, fewer follow-up calls.";
|
|
29
|
-
readonly default: "concise";
|
|
30
|
-
};
|
|
31
|
-
readonly section: {
|
|
32
|
-
readonly type: "string";
|
|
33
|
-
readonly description: "Restrict docs to one section, exactly, e.g. \"Help\". Call with no arguments to see the sections.";
|
|
34
|
-
};
|
|
35
|
-
readonly category: {
|
|
36
|
-
readonly type: "string";
|
|
37
|
-
readonly description: "Restrict demos to one category, exactly, e.g. \"Kanban\". Call with no arguments to see the categories.";
|
|
38
|
-
};
|
|
39
|
-
readonly limit: {
|
|
40
|
-
readonly type: "number";
|
|
41
|
-
readonly description: "Max results per corpus. Default 10, max 50.";
|
|
42
|
-
readonly default: 10;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
readonly required: readonly [];
|
|
46
|
-
};
|
|
47
|
-
}, {
|
|
48
|
-
readonly name: "svgrid_get";
|
|
49
|
-
readonly title: "Read a doc or demo";
|
|
50
|
-
readonly description: "Fetch one thing in full by reference: a doc slug (\"help/columns/column-definitions\"), a demo id (\"11-stock-market\"), or \"api\" for the curated API reference. Use svgrid_search first to find the reference.";
|
|
51
|
-
readonly inputSchema: {
|
|
52
|
-
readonly type: "object";
|
|
53
|
-
readonly properties: {
|
|
54
|
-
readonly ref: {
|
|
55
|
-
readonly type: "string";
|
|
56
|
-
readonly description: "A doc slug, a demo id, \"api\", or a schema id such as \"chart-spec\" (or \"chart spec schema\"). The kind is inferred; pass `kind` to force it.";
|
|
57
|
-
};
|
|
58
|
-
readonly kind: {
|
|
59
|
-
readonly type: "string";
|
|
60
|
-
readonly enum: readonly ["auto", "doc", "example", "api", "schema"];
|
|
61
|
-
readonly description: "Override the inferred kind. Default \"auto\".";
|
|
62
|
-
readonly default: "auto";
|
|
63
|
-
};
|
|
64
|
-
readonly detail: {
|
|
65
|
-
readonly type: "string";
|
|
66
|
-
readonly enum: readonly ["concise", "full"];
|
|
67
|
-
readonly description: "\"full\" (default) returns the whole thing; \"concise\" truncates long content.";
|
|
68
|
-
readonly default: "full";
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
readonly required: readonly ["ref"];
|
|
72
|
-
};
|
|
73
|
-
}];
|
|
74
9
|
export declare function handleCoreTool(name: string, args: Record<string, unknown>): ToolResult | undefined;
|
package/dist/core-tools.js
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
import { apiReference, apiSurface, docs, examples, schemas } from './data.js';
|
|
17
17
|
import { meaningfulTerms, rankDocs } from './search.js';
|
|
18
18
|
import { ENTERPRISE_LINE, ENTERPRISE_NOTE, importsEnterprise, isEnterpriseDoc, isPaidQuestion } from './enterprise.js';
|
|
19
|
+
export { CORE_TOOLS } from './tool-defs.js';
|
|
19
20
|
const DOCS_FOOTER = `\n\nSvGrid reference: full docs & ${examples.length} live demos at https://svgrid.com/docs`;
|
|
20
21
|
const text = (body) => ({ content: [{ type: 'text', text: body }] });
|
|
21
22
|
const withDocs = (body) => text(body + DOCS_FOOTER);
|
|
@@ -74,71 +75,6 @@ const apiNames = (() => {
|
|
|
74
75
|
/** Docs and demos that use the paid package, found once from their source. */
|
|
75
76
|
const enterpriseDocs = new Set(docs.filter((d) => isEnterpriseDoc(d.slug, d.markdown)).map((d) => d.slug));
|
|
76
77
|
const enterpriseExamples = new Set(examples.filter((e) => importsEnterprise(e.source)).map((e) => e.id));
|
|
77
|
-
export const CORE_TOOLS = [
|
|
78
|
-
{
|
|
79
|
-
name: 'svgrid_search',
|
|
80
|
-
title: 'Search SvGrid',
|
|
81
|
-
description: 'Search SvGrid docs, example demos and the API surface in ONE call. Start here for any "how do I ..." question - it covers all three, so you do not have to guess which one holds the answer. Call with no arguments for an index of doc sections, demo categories and API groups. Returns ids/slugs you can pass to svgrid_get.',
|
|
82
|
-
inputSchema: {
|
|
83
|
-
type: 'object',
|
|
84
|
-
properties: {
|
|
85
|
-
query: {
|
|
86
|
-
type: 'string',
|
|
87
|
-
description: 'What you are trying to do, e.g. "pin a column", "server side pagination", "kanban swimlanes". Omit for the index.',
|
|
88
|
-
},
|
|
89
|
-
kind: {
|
|
90
|
-
type: 'string',
|
|
91
|
-
enum: ['all', 'docs', 'examples', 'api'],
|
|
92
|
-
description: 'Restrict the search. Default "all".',
|
|
93
|
-
default: 'all',
|
|
94
|
-
},
|
|
95
|
-
detail: {
|
|
96
|
-
type: 'string',
|
|
97
|
-
enum: ['concise', 'full'],
|
|
98
|
-
description: '"concise" (default) returns titles plus a short excerpt. "full" returns the matching doc excerpts at length - more tokens, fewer follow-up calls.',
|
|
99
|
-
default: 'concise',
|
|
100
|
-
},
|
|
101
|
-
section: {
|
|
102
|
-
type: 'string',
|
|
103
|
-
description: 'Restrict docs to one section, exactly, e.g. "Help". Call with no arguments to see the sections.',
|
|
104
|
-
},
|
|
105
|
-
category: {
|
|
106
|
-
type: 'string',
|
|
107
|
-
description: 'Restrict demos to one category, exactly, e.g. "Kanban". Call with no arguments to see the categories.',
|
|
108
|
-
},
|
|
109
|
-
limit: { type: 'number', description: 'Max results per corpus. Default 10, max 50.', default: 10 },
|
|
110
|
-
},
|
|
111
|
-
required: [],
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
name: 'svgrid_get',
|
|
116
|
-
title: 'Read a doc or demo',
|
|
117
|
-
description: 'Fetch one thing in full by reference: a doc slug ("help/columns/column-definitions"), a demo id ("11-stock-market"), or "api" for the curated API reference. Use svgrid_search first to find the reference.',
|
|
118
|
-
inputSchema: {
|
|
119
|
-
type: 'object',
|
|
120
|
-
properties: {
|
|
121
|
-
ref: {
|
|
122
|
-
type: 'string',
|
|
123
|
-
description: 'A doc slug, a demo id, "api", or a schema id such as "chart-spec" (or "chart spec schema"). The kind is inferred; pass `kind` to force it.',
|
|
124
|
-
},
|
|
125
|
-
kind: {
|
|
126
|
-
type: 'string',
|
|
127
|
-
enum: ['auto', 'doc', 'example', 'api', 'schema'],
|
|
128
|
-
description: 'Override the inferred kind. Default "auto".',
|
|
129
|
-
default: 'auto',
|
|
130
|
-
},
|
|
131
|
-
detail: {
|
|
132
|
-
type: 'string',
|
|
133
|
-
enum: ['concise', 'full'],
|
|
134
|
-
description: '"full" (default) returns the whole thing; "concise" truncates long content.',
|
|
135
|
-
default: 'full',
|
|
136
|
-
},
|
|
137
|
-
},
|
|
138
|
-
required: ['ref'],
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
];
|
|
142
78
|
/** Rank examples by a term match over id/title/blurb, optionally within a category. */
|
|
143
79
|
function searchExamples(query, limit, category) {
|
|
144
80
|
const pool = category
|