@toolbeltai/skills 0.1.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/LICENSE +21 -0
- package/README.md +64 -0
- package/assets/demos/fake-curl.sh +3 -0
- package/assets/demos/geo-analyst-demo.sh +85 -0
- package/assets/demos/run-toolbelt-demo.sh +66 -0
- package/assets/geo-analyst-demo.gif +0 -0
- package/assets/run-toolbelt-demo.gif +0 -0
- package/assets/signup-demo.gif +0 -0
- package/bin/install.js +110 -0
- package/data-blend/SKILL.md +283 -0
- package/geo-analyst/README.md +7 -0
- package/geo-analyst/SKILL.md +241 -0
- package/knowledge-graph/SKILL.md +354 -0
- package/multi-agent-workspace/SKILL.md +217 -0
- package/package.json +51 -0
- package/run-toolbelt/README.md +122 -0
- package/run-toolbelt/SKILL.md +238 -0
- package/sql-analyst/SKILL.md +232 -0
- package/streaming-analyst/SKILL.md +351 -0
- package/vector-search/SKILL.md +259 -0
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: multi-agent-workspace
|
|
3
|
+
description: >
|
|
4
|
+
Set up a shared Toolbelt workspace for multi-agent collaboration. Toolbelt is a
|
|
5
|
+
multi-modal data platform combining SQL analytics, vector search, and real-time
|
|
6
|
+
streaming. Uploads a document to a namespace, generates a shareable asset URL,
|
|
7
|
+
and emits connection instructions for a second agent to join the same workspace.
|
|
8
|
+
Use when two or more agents need to share data, or when handing off context
|
|
9
|
+
between sessions without duplicating ingestion work.
|
|
10
|
+
license: MIT
|
|
11
|
+
compatibility: >
|
|
12
|
+
Requires a Toolbelt account (provision free at https://toolbelt.ai) and an
|
|
13
|
+
MCP-compatible AI agent (Claude Code, Claude Desktop, or any client that
|
|
14
|
+
supports MCP server connections). MCP connection must be pre-established
|
|
15
|
+
before invocation.
|
|
16
|
+
metadata:
|
|
17
|
+
author: toolbeltai
|
|
18
|
+
version: "1.0"
|
|
19
|
+
openclaw:
|
|
20
|
+
emoji: "🤝"
|
|
21
|
+
homepage: "https://toolbelt.ai/docs/multi-agent"
|
|
22
|
+
skillKey: "multi-agent-workspace"
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
Set up a shared Toolbelt workspace and generate collaboration artifacts for a
|
|
26
|
+
second agent using Toolbelt MCP tools. Work through each phase in order without
|
|
27
|
+
prompting for user input. On unrecoverable error, emit a structured failure and halt.
|
|
28
|
+
|
|
29
|
+
## When Not To Use
|
|
30
|
+
|
|
31
|
+
- For single-agent workflows where data sharing between agents is not needed.
|
|
32
|
+
- When you only need to analyze data yourself — use `sql-analyst`, `streaming-analyst`, or `knowledge-graph` instead.
|
|
33
|
+
|
|
34
|
+
## Invocation Parameters
|
|
35
|
+
|
|
36
|
+
Extract these from the args string or conversation context before starting:
|
|
37
|
+
|
|
38
|
+
| Parameter | Required | Description |
|
|
39
|
+
|---|---|---|
|
|
40
|
+
| `namespace_id` | No | UUID of target namespace. Auto-select if omitted and only one exists; fail if ambiguous. |
|
|
41
|
+
| `document_content` | No | Raw text to upload as the shared document. Uses the embedded sample if omitted. |
|
|
42
|
+
| `document_name` | No | Name for the shared document asset. Defaults to `shared-workspace-doc`. |
|
|
43
|
+
| `expires_in_days` | No | Days until the share link expires. Defaults to `7`. |
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Default Sample Document
|
|
48
|
+
|
|
49
|
+
If no `document_content` is provided, use this research briefing verbatim:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
Project Aurora: Q1 Research Briefing
|
|
53
|
+
|
|
54
|
+
This briefing summarizes findings from the Aurora team's Q1 initiative on
|
|
55
|
+
sustainable materials for industrial packaging.
|
|
56
|
+
|
|
57
|
+
Key findings:
|
|
58
|
+
- Bio-composite material BX-14 achieved 87% tensile strength retention after
|
|
59
|
+
6 months in humid storage conditions, outperforming the baseline polymer by 22%.
|
|
60
|
+
- Pilot production run at the Riverside facility yielded 94% defect-free units,
|
|
61
|
+
meeting the target threshold of 90% set by the operations team.
|
|
62
|
+
- Cost per unit for BX-14 is currently $0.42, compared to $0.31 for the baseline.
|
|
63
|
+
The team projects cost parity by Q3 as production volume scales.
|
|
64
|
+
|
|
65
|
+
Risks identified:
|
|
66
|
+
- Supplier lead time for BX-14 precursors is 14 weeks, creating potential
|
|
67
|
+
inventory gaps if demand spikes. Procurement has been notified.
|
|
68
|
+
- Field testing in sub-zero conditions (-15°C) is pending. Results expected by
|
|
69
|
+
end of April.
|
|
70
|
+
|
|
71
|
+
Next steps:
|
|
72
|
+
- Dr. Maya Patel (materials lead) to complete cold-weather field tests by April 30.
|
|
73
|
+
- Operations team to submit revised unit cost forecast by April 15.
|
|
74
|
+
- Executive review scheduled for May 8, presenting go/no-go recommendation for
|
|
75
|
+
full-scale production in Q3.
|
|
76
|
+
|
|
77
|
+
Prepared by: Aurora Research Team
|
|
78
|
+
Date: March 28, 2024
|
|
79
|
+
Classification: Internal — Project Team Only
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Phase 0: Verify Connection
|
|
85
|
+
|
|
86
|
+
Call `get_semantic_names` (no arguments) immediately.
|
|
87
|
+
|
|
88
|
+
- **If it succeeds:** proceed to Phase 1 using the returned namespaces.
|
|
89
|
+
- **If it fails:** emit structured failure and halt.
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
FAILURE: Toolbelt MCP connection is not established.
|
|
93
|
+
The MCP server must be connected before invoking this skill.
|
|
94
|
+
See: https://toolbelt.ai/docs/mcp for setup instructions.
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Phase 1: Resolve Namespace
|
|
100
|
+
|
|
101
|
+
Use the namespaces returned from Phase 0.
|
|
102
|
+
|
|
103
|
+
Resolution order:
|
|
104
|
+
1. If `namespace_id` was provided as a parameter, use it directly.
|
|
105
|
+
2. If only one namespace exists, use it.
|
|
106
|
+
3. If multiple exist and no `namespace_id` was specified, emit structured failure and halt.
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
FAILURE: Multiple namespaces found and none specified.
|
|
110
|
+
Available: [<list namespace display names and IDs>]
|
|
111
|
+
Re-invoke with namespace_id=<uuid>.
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Store the resolved `namespace_id` and the namespace display name — both appear in the RESULT.
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Phase 2: Upload Shared Document
|
|
119
|
+
|
|
120
|
+
Resolve `document_content` (use parameter value or default sample above).
|
|
121
|
+
Resolve `document_name` (use parameter value or default `shared-workspace-doc`).
|
|
122
|
+
|
|
123
|
+
Call `toolbelt_save`:
|
|
124
|
+
|
|
125
|
+
```json
|
|
126
|
+
{
|
|
127
|
+
"asset_type": "document",
|
|
128
|
+
"namespace_id": "<namespace_id>",
|
|
129
|
+
"name": "<document_name>",
|
|
130
|
+
"file_name": "document.txt",
|
|
131
|
+
"content": "<document_content>",
|
|
132
|
+
"content_encoding": "text"
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Record the returned `asset_id` — it is required for `toolbelt_share` in Phase 4.
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## Phase 3: Poll for Ingestion
|
|
141
|
+
|
|
142
|
+
Call `toolbelt_jobs` with `{ "namespace_id": "<namespace_id>" }` every 10 seconds.
|
|
143
|
+
|
|
144
|
+
Wait for the `ingest` job to reach `completed`. Typical duration: 15–60 seconds. Maximum wait: 3 minutes.
|
|
145
|
+
|
|
146
|
+
If the job reaches `failed` or the timeout elapses, emit structured failure and halt:
|
|
147
|
+
```
|
|
148
|
+
FAILURE: Document ingestion did not complete.
|
|
149
|
+
Job status: <last observed status>
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Phase 4: Generate Share URL
|
|
155
|
+
|
|
156
|
+
Call `toolbelt_share` with the `asset_id` from Phase 2:
|
|
157
|
+
|
|
158
|
+
```json
|
|
159
|
+
{
|
|
160
|
+
"namespace_id": "<namespace_id>",
|
|
161
|
+
"asset_id": "<asset_id>",
|
|
162
|
+
"expiresInDays": <expires_in_days or 7>
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Parse the response to extract:
|
|
167
|
+
- `share_url`: the shareable download/view link for the document
|
|
168
|
+
- `expires_at`: expiration date of the link (if returned)
|
|
169
|
+
|
|
170
|
+
If the call fails, emit structured failure and halt:
|
|
171
|
+
```
|
|
172
|
+
FAILURE: toolbelt_share failed.
|
|
173
|
+
Error: <error message>
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## Phase 5: Structured Output
|
|
179
|
+
|
|
180
|
+
After all phases complete, emit a single structured result followed by
|
|
181
|
+
second-agent connection instructions.
|
|
182
|
+
|
|
183
|
+
```
|
|
184
|
+
RESULT:
|
|
185
|
+
namespace_id: <uuid>
|
|
186
|
+
namespace_name: <display name>
|
|
187
|
+
document_name: <name of uploaded document>
|
|
188
|
+
asset_id: <uuid of the uploaded asset>
|
|
189
|
+
phases_run: [0, 1, 2, 3, 4]
|
|
190
|
+
|
|
191
|
+
share_url: <URL returned by toolbelt_share>
|
|
192
|
+
expires_in_days: <days until expiry>
|
|
193
|
+
|
|
194
|
+
second_agent_instructions:
|
|
195
|
+
connect_via: "MCP server configured to point at https://toolbelt.ai"
|
|
196
|
+
namespace_id: <uuid>
|
|
197
|
+
steps:
|
|
198
|
+
1. "Configure the MCP server with your Toolbelt API key"
|
|
199
|
+
2. "Pass namespace_id=<uuid> to scope the agent to this workspace"
|
|
200
|
+
3. "Call toolbelt_context to see the shared document in the namespace"
|
|
201
|
+
4. "Call toolbelt_search to ask questions about the shared document"
|
|
202
|
+
note: "Both agents share the same namespace — any document, table, or query
|
|
203
|
+
result one agent uploads is immediately visible to the other."
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Tool Reference
|
|
209
|
+
|
|
210
|
+
| Phase | Tool(s) |
|
|
211
|
+
|---|---|
|
|
212
|
+
| 0. Verify connection | `get_semantic_names` |
|
|
213
|
+
| 1. Resolve namespace | (from Phase 0 result) |
|
|
214
|
+
| 2. Upload document | `toolbelt_save` |
|
|
215
|
+
| 3. Poll for ingestion | `toolbelt_jobs` |
|
|
216
|
+
| 4. Generate share URL | `toolbelt_share` |
|
|
217
|
+
| 5. Emit result | (structured output) |
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@toolbeltai/skills",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Official Toolbelt skills for Claude Code and MCP agents — run-toolbelt, geo-analyst, knowledge-graph, sql-analyst, vector-search, streaming-analyst, multi-agent-workspace, data-blend.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://toolbelt.ai",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/toolbeltai/toolbelt-skills.git"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/toolbeltai/toolbelt-skills/issues"
|
|
13
|
+
},
|
|
14
|
+
"author": "Toolbelt",
|
|
15
|
+
"keywords": [
|
|
16
|
+
"toolbelt",
|
|
17
|
+
"claude-code",
|
|
18
|
+
"mcp",
|
|
19
|
+
"skills",
|
|
20
|
+
"openclaw",
|
|
21
|
+
"sql",
|
|
22
|
+
"knowledge-graph",
|
|
23
|
+
"geospatial",
|
|
24
|
+
"vector-search"
|
|
25
|
+
],
|
|
26
|
+
"bin": {
|
|
27
|
+
"toolbelt-skills": "./bin/install.js"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"bin",
|
|
31
|
+
"assets",
|
|
32
|
+
"data-blend",
|
|
33
|
+
"geo-analyst",
|
|
34
|
+
"knowledge-graph",
|
|
35
|
+
"multi-agent-workspace",
|
|
36
|
+
"run-toolbelt",
|
|
37
|
+
"sql-analyst",
|
|
38
|
+
"streaming-analyst",
|
|
39
|
+
"vector-search",
|
|
40
|
+
"LICENSE",
|
|
41
|
+
"README.md"
|
|
42
|
+
],
|
|
43
|
+
"type": "module",
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=18"
|
|
46
|
+
},
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"access": "public",
|
|
49
|
+
"registry": "https://registry.npmjs.org/"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# run-toolbelt
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
Autonomous end-to-end Toolbelt agent. Provisions a namespace, ingests documents, connects streaming data sources, and answers questions — all without human interaction.
|
|
6
|
+
|
|
7
|
+
Invoke via `/run-toolbelt` in Claude Code, or via the `Skill` tool in any MCP-capable agent.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Parameters
|
|
12
|
+
|
|
13
|
+
| Parameter | Required | Description |
|
|
14
|
+
|---|---|---|
|
|
15
|
+
| `namespace_id` | No | UUID of target namespace. Auto-selected if only one exists. |
|
|
16
|
+
| `document_content` | No* | Raw text to upload as a document |
|
|
17
|
+
| `document_url` | No* | Public URL to a file (PDF, DOCX, etc.) |
|
|
18
|
+
| `document_name` | No | Name for the asset. Derived from URL or auto-generated if omitted. |
|
|
19
|
+
| `kafka_broker` | No | Kafka broker URL (e.g. `kafka-broker:9092`) |
|
|
20
|
+
| `kafka_topic` | No | Kafka topic name |
|
|
21
|
+
| `kafka_schema` | No | SQL-style column schema (e.g. `id INTEGER, event VARCHAR(256), ts TIMESTAMP`) |
|
|
22
|
+
| `kafka_group_id` | No | Kafka consumer group ID |
|
|
23
|
+
| `question` | No | Question to answer over ingested data |
|
|
24
|
+
|
|
25
|
+
*At least one of `document_content` or `document_url` is required to run document ingestion. Phases are skipped if their required parameters are absent.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
### Smoke test — connection and namespace only
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
/run-toolbelt
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Runs phases 0–2. Verifies the MCP connection is live and resolves your namespace. No data is written.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
### Ingest a document and ask a question
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
/run-toolbelt document_url=https://example.com/report.pdf question="What are the key findings?"
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
/run-toolbelt document_content="Q1 revenue was $4.2M across three product lines." document_name="q1-summary" question="What was Q1 revenue?"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
### Target a specific namespace
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
/run-toolbelt namespace_id=<uuid> document_url=https://example.com/report.pdf question="Summarize this."
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Required when your account has multiple namespaces. Omit to auto-select when only one exists.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
### Connect a Kafka source
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
/run-toolbelt kafka_broker=kafka-broker:9092 kafka_topic=events kafka_schema="id INTEGER, event VARCHAR(256), ts TIMESTAMP"
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Connects the topic and verifies it is queryable. Combine with `question` to search over streaming data.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
### Full pipeline
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
/run-toolbelt \
|
|
77
|
+
namespace_id=<uuid> \
|
|
78
|
+
document_url=https://example.com/report.pdf \
|
|
79
|
+
kafka_broker=kafka-broker:9092 \
|
|
80
|
+
kafka_topic=events \
|
|
81
|
+
kafka_schema="id INTEGER, event VARCHAR(256), ts TIMESTAMP" \
|
|
82
|
+
question="What events occurred after the report's cutoff date?"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Runs all phases: document ingestion, Kafka connection, and cross-source search.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
### From another agent (Skill tool)
|
|
90
|
+
|
|
91
|
+
```javascript
|
|
92
|
+
{ skill: "run-toolbelt", args: "namespace_id=<uuid> document_url=https://... question=..." }
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
The skill emits a structured `RESULT:` block — parseable by the calling agent without human interpretation.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Output
|
|
100
|
+
|
|
101
|
+
On success:
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
RESULT:
|
|
105
|
+
namespace_id: <uuid>
|
|
106
|
+
phases_run: [0, 1, 2, 3, 5]
|
|
107
|
+
document_table: <table name>
|
|
108
|
+
kafka_table: <table name, if Phase 4 ran>
|
|
109
|
+
answer: |
|
|
110
|
+
<synthesized answer>
|
|
111
|
+
sql_generated: <SQL, if any>
|
|
112
|
+
sources: [<cited documents>]
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
On failure:
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
FAILURE: <reason>
|
|
119
|
+
<diagnostic detail>
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Failures are terminal — the skill halts and does not continue to subsequent phases.
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: run-toolbelt
|
|
3
|
+
description: >
|
|
4
|
+
Toolbelt is a multi-modal data platform combining SQL analytics, vector search,
|
|
5
|
+
and real-time streaming — all queryable through natural language via MCP. This
|
|
6
|
+
skill provisions a namespace, ingests documents, connects Kafka topics, and
|
|
7
|
+
answers questions over the ingested data, end-to-end and autonomously. Use when
|
|
8
|
+
an AI agent needs to onboard to Toolbelt, add assets, connect a streaming source,
|
|
9
|
+
or run queries without any human interaction.
|
|
10
|
+
license: MIT
|
|
11
|
+
compatibility: >
|
|
12
|
+
Requires a Toolbelt account (provision free at https://toolbelt.ai) and an
|
|
13
|
+
MCP-compatible AI agent (Claude Code, Claude Desktop, OpenClaw, or any client
|
|
14
|
+
that supports MCP server connections). MCP connection must be pre-established
|
|
15
|
+
before invocation.
|
|
16
|
+
metadata:
|
|
17
|
+
author: toolbeltai
|
|
18
|
+
version: "2.0"
|
|
19
|
+
openclaw:
|
|
20
|
+
emoji: "🧰"
|
|
21
|
+
homepage: "https://toolbelt.ai/docs/mcp"
|
|
22
|
+
skillKey: "run-toolbelt"
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
Execute Toolbelt end-to-end autonomously using the Toolbelt MCP tools.
|
|
26
|
+
Work through each phase in order. Extract all required inputs from task parameters
|
|
27
|
+
or invocation context — do not prompt for user input. Progress through phases
|
|
28
|
+
without confirmation. On unrecoverable error, emit a structured failure and halt.
|
|
29
|
+
|
|
30
|
+
## When Not To Use
|
|
31
|
+
|
|
32
|
+
- When the Toolbelt MCP connection is not yet established — the connection must exist before invocation.
|
|
33
|
+
- When you only need to query data already in Toolbelt — use `sql-analyst` instead.
|
|
34
|
+
- When you only need to upload and analyze a CSV — use `sql-analyst` instead.
|
|
35
|
+
|
|
36
|
+
## Invocation Parameters
|
|
37
|
+
|
|
38
|
+
Extract these from the args string or conversation context before starting:
|
|
39
|
+
|
|
40
|
+
| Parameter | Required | Description |
|
|
41
|
+
|---|---|---|
|
|
42
|
+
| `namespace_id` | No | UUID of target namespace. Auto-select if omitted and only one exists; fail if ambiguous. |
|
|
43
|
+
| `document_content` | No* | Raw text content to upload as a document asset |
|
|
44
|
+
| `document_url` | No* | Public URL to a file (PDF, DOCX, etc.) to upload |
|
|
45
|
+
| `document_name` | No | Name for the document asset. Derive from URL filename or generate if omitted. |
|
|
46
|
+
| `kafka_broker` | No | Kafka broker URL (e.g. `kafka-broker:9092`) |
|
|
47
|
+
| `kafka_topic` | No | Kafka topic name |
|
|
48
|
+
| `kafka_schema` | No | SQL-style column schema (e.g. `id INTEGER, event VARCHAR(256), ts TIMESTAMP`) |
|
|
49
|
+
| `kafka_group_id` | No | Kafka consumer group ID |
|
|
50
|
+
| `question` | No | Question to ask over ingested data in Phase 5 |
|
|
51
|
+
|
|
52
|
+
*At least one of `document_content` or `document_url` is required to run Phase 3.
|
|
53
|
+
Skip Phase 3 if neither is provided. Skip Phase 4 if Kafka parameters are absent.
|
|
54
|
+
Skip Phase 5 if `question` is absent.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Phase 0: Verify Connection
|
|
59
|
+
|
|
60
|
+
Call `get_semantic_names` (no arguments) immediately.
|
|
61
|
+
|
|
62
|
+
- **If it succeeds:** proceed to Phase 1 using the returned namespaces.
|
|
63
|
+
- **If it fails:** emit structured failure and halt.
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
FAILURE: Toolbelt MCP connection is not established.
|
|
67
|
+
The MCP server must be connected before invoking this skill.
|
|
68
|
+
See: https://toolbelt.ai/docs/mcp for setup instructions.
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Do not attempt reconnection or emit manual setup instructions. The connection
|
|
72
|
+
is an environment contract that must be satisfied before invocation.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Phase 1: Resolve Namespace
|
|
77
|
+
|
|
78
|
+
Use the namespaces returned from Phase 0.
|
|
79
|
+
|
|
80
|
+
Resolution order:
|
|
81
|
+
1. If `namespace_id` was provided as a parameter, use it directly.
|
|
82
|
+
2. If only one namespace exists, use it.
|
|
83
|
+
3. If multiple exist and no `namespace_id` was specified, emit structured failure and halt.
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
FAILURE: Multiple namespaces found and none specified.
|
|
87
|
+
Available: [<list namespace display names and IDs>]
|
|
88
|
+
Re-invoke with namespace_id=<uuid>.
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Store the resolved `namespace_id` — pass it to every subsequent tool call.
|
|
92
|
+
Never use the display name as the ID.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Phase 2: Inspect Current State
|
|
97
|
+
|
|
98
|
+
Call `toolbelt_context` with the resolved `namespace_id`.
|
|
99
|
+
|
|
100
|
+
Store the returned context internally:
|
|
101
|
+
- Relational tables (`relevant_tables`, `table_schemas`)
|
|
102
|
+
- Vector collections (`collections`)
|
|
103
|
+
- Domain summary and suggested prompts
|
|
104
|
+
|
|
105
|
+
Do not output a summary unless this is the only phase being run.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Phase 3: Add a Document Asset
|
|
110
|
+
|
|
111
|
+
Skip this phase if neither `document_content` nor `document_url` was provided.
|
|
112
|
+
|
|
113
|
+
Derive `document_name` from URL filename if not provided. If content was provided
|
|
114
|
+
directly and no name exists, use `document-<ISO timestamp>`.
|
|
115
|
+
|
|
116
|
+
Call `toolbelt_save`:
|
|
117
|
+
|
|
118
|
+
**From text content:**
|
|
119
|
+
```json
|
|
120
|
+
{
|
|
121
|
+
"asset_type": "document",
|
|
122
|
+
"namespace_id": "<namespace_id>",
|
|
123
|
+
"name": "<document_name>",
|
|
124
|
+
"file_name": "document.txt",
|
|
125
|
+
"content": "<document_content>",
|
|
126
|
+
"content_encoding": "text"
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**From a public URL:**
|
|
131
|
+
```json
|
|
132
|
+
{
|
|
133
|
+
"asset_type": "document",
|
|
134
|
+
"namespace_id": "<namespace_id>",
|
|
135
|
+
"name": "<document_name>",
|
|
136
|
+
"file_name": "<filename from URL>",
|
|
137
|
+
"file_url": "<document_url>"
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Poll for completion
|
|
142
|
+
|
|
143
|
+
Call `toolbelt_jobs` with `{ "namespace_id": "<namespace_id>" }` every 10 seconds.
|
|
144
|
+
|
|
145
|
+
Job chain: `ingest` (parse + store) → `semantic` (embed + extract entities). Both must reach `completed`.
|
|
146
|
+
Typical duration: 30–120 seconds. Maximum wait: 5 minutes.
|
|
147
|
+
|
|
148
|
+
If either job reaches `failed` or the timeout elapses, emit structured failure and halt:
|
|
149
|
+
```
|
|
150
|
+
FAILURE: Document ingestion did not complete.
|
|
151
|
+
Job status: <last observed status>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Once complete, call `toolbelt_context` again to confirm the new asset's table appears.
|
|
155
|
+
Record the new table name for use in Phase 5.
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## Phase 4: Connect a Kafka Source
|
|
160
|
+
|
|
161
|
+
Skip this phase if `kafka_broker` or `kafka_topic` is absent.
|
|
162
|
+
|
|
163
|
+
Call `toolbelt_connect`:
|
|
164
|
+
```json
|
|
165
|
+
{
|
|
166
|
+
"source_type": "kafka",
|
|
167
|
+
"namespace_id": "<namespace_id>",
|
|
168
|
+
"location": "KAFKA://<kafka_broker>",
|
|
169
|
+
"external_table_name": "<kafka_topic>",
|
|
170
|
+
"asset_name": "<kafka_topic>",
|
|
171
|
+
"kafka_column_definitions": "<kafka_schema>",
|
|
172
|
+
"kafka_subscribe": true,
|
|
173
|
+
"extra_options": { "kafka.group.id": "<kafka_group_id>" }
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Omit `extra_options` if `kafka_group_id` was not provided.
|
|
178
|
+
|
|
179
|
+
Verify the table is queryable with `toolbelt_execute`:
|
|
180
|
+
```json
|
|
181
|
+
{
|
|
182
|
+
"namespace_id": "<namespace_id>",
|
|
183
|
+
"query": "SELECT COUNT(*) FROM <kafka_topic> LIMIT 1"
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
If the query fails, emit structured failure and halt:
|
|
188
|
+
```
|
|
189
|
+
FAILURE: Kafka source connected but table is not queryable.
|
|
190
|
+
Query: SELECT COUNT(*) FROM <kafka_topic> LIMIT 1
|
|
191
|
+
Error: <error message>
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## Phase 5: Ask a Question
|
|
197
|
+
|
|
198
|
+
Skip this phase if `question` was not provided.
|
|
199
|
+
|
|
200
|
+
Call `toolbelt_search`:
|
|
201
|
+
```json
|
|
202
|
+
{
|
|
203
|
+
"question": "<question>",
|
|
204
|
+
"namespace_id": "<namespace_id>",
|
|
205
|
+
"synthesize": true
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## Structured Output
|
|
212
|
+
|
|
213
|
+
After all phases complete, emit a single structured result:
|
|
214
|
+
|
|
215
|
+
```
|
|
216
|
+
RESULT:
|
|
217
|
+
namespace_id: <uuid>
|
|
218
|
+
phases_run: [0, 1, 2, ...]
|
|
219
|
+
document_table: <table name, if Phase 3 ran>
|
|
220
|
+
kafka_table: <table name, if Phase 4 ran>
|
|
221
|
+
answer: |
|
|
222
|
+
<synthesized answer from toolbelt_search, if Phase 5 ran>
|
|
223
|
+
sql_generated: <SQL from search result, if any>
|
|
224
|
+
sources: [<cited source documents, if any>]
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## Tool Reference
|
|
230
|
+
|
|
231
|
+
| Phase | Tool(s) |
|
|
232
|
+
|---|---|
|
|
233
|
+
| 0. Verify connection | `get_semantic_names` |
|
|
234
|
+
| 1. Resolve namespace | (from Phase 0 result) |
|
|
235
|
+
| 2. Inspect state | `toolbelt_context` |
|
|
236
|
+
| 3. Add document | `toolbelt_save`, `toolbelt_jobs`, `toolbelt_context` |
|
|
237
|
+
| 4. Connect Kafka | `toolbelt_connect`, `toolbelt_execute` |
|
|
238
|
+
| 5. Ask a question | `toolbelt_search` |
|