tunc-mcp 0.1.1 → 0.1.3
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 +42 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -91,27 +91,64 @@ import { orb, art, doc } from 'tunc-mcp';
|
|
|
91
91
|
|
|
92
92
|
const memory = orb(); // reads TUNC_API_KEY
|
|
93
93
|
|
|
94
|
+
// Every tool takes an `operation` that picks what it does. Ask for a shape the
|
|
95
|
+
// server does not have and you get invalid_arguments back, so call listTools()
|
|
96
|
+
// once and read the real schemas rather than trusting an example.
|
|
97
|
+
//
|
|
98
|
+
// data_write operation: create | append
|
|
99
|
+
// data_read operation: shelves | list | get | log | search | status
|
|
100
|
+
// data_update operation: replace | patch (needs if_revision)
|
|
101
|
+
// data_delete operation: record | entries | log (needs if_revision)
|
|
102
|
+
|
|
94
103
|
// Agent memory: durable records, revision-guarded
|
|
95
104
|
await memory.callTool('data_write', {
|
|
105
|
+
operation: 'create',
|
|
96
106
|
name: 'contacts/ada',
|
|
97
107
|
about: 'Primary contact, Example Ltd',
|
|
98
108
|
value: { email: 'ada@example.com', timezone: 'Europe/London' },
|
|
99
109
|
});
|
|
100
110
|
|
|
101
|
-
|
|
111
|
+
const record = await memory.callTool('data_read', {
|
|
112
|
+
operation: 'get',
|
|
113
|
+
name: 'contacts/ada',
|
|
114
|
+
});
|
|
115
|
+
const revision = JSON.parse(record.content[0].text).revision;
|
|
116
|
+
|
|
117
|
+
// Change it only if nobody else has, and delete it the same way
|
|
118
|
+
await memory.callTool('data_update', {
|
|
119
|
+
operation: 'patch',
|
|
120
|
+
name: 'contacts/ada',
|
|
121
|
+
if_revision: revision,
|
|
122
|
+
patch: [{ op: 'replace', path: '/timezone', value: 'Europe/Paris' }],
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
await memory.callTool('data_delete', {
|
|
126
|
+
operation: 'record',
|
|
127
|
+
name: 'contacts/ada',
|
|
128
|
+
if_revision: revision,
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
// Artifacts: store a file, get a private link back.
|
|
132
|
+
// art_read is operation list|get; art_write is operation create; art_delete
|
|
133
|
+
// takes an artifact_id and nothing else.
|
|
102
134
|
const files = art();
|
|
103
|
-
await files.callTool('art_write', {
|
|
104
|
-
|
|
135
|
+
const stored = await files.callTool('art_write', {
|
|
136
|
+
operation: 'create',
|
|
137
|
+
name: 'quarterly-report.pdf',
|
|
105
138
|
mime_type: 'application/pdf',
|
|
106
139
|
content_base64: base64Bytes,
|
|
107
140
|
});
|
|
141
|
+
// the result nests the artifact, keyed by `id`, with a viewer_url to share
|
|
142
|
+
const artifactId = JSON.parse(stored.content[0].text).artifact.id;
|
|
108
143
|
|
|
109
|
-
// Documents: build something a human can open and edit
|
|
144
|
+
// Documents: build something a human can open and edit.
|
|
145
|
+
// doc_create needs only a title; doc_read, doc_write and doc_delete take `doc`.
|
|
110
146
|
const docs = doc();
|
|
111
|
-
await docs.callTool('doc_create', {
|
|
147
|
+
const made = await docs.callTool('doc_create', {
|
|
112
148
|
title: 'Q4 summary',
|
|
113
149
|
markdown: '# Q4\n\nRevenue up 12%.',
|
|
114
150
|
});
|
|
151
|
+
const docId = JSON.parse(made.content[0].text).result.doc.id;
|
|
115
152
|
```
|
|
116
153
|
|
|
117
154
|
Discover what any service offers:
|
package/package.json
CHANGED