tunc-mcp 0.1.1 → 0.1.2
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 +30 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -91,13 +91,43 @@ 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
|
|
|
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
|
+
|
|
101
131
|
// Artifacts: store a file, get a private link
|
|
102
132
|
const files = art();
|
|
103
133
|
await files.callTool('art_write', {
|
package/package.json
CHANGED