@theronap/agnoclast-mcp 0.9.225 → 0.9.226
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/lib/server.mjs +43 -0
- package/package.json +1 -1
package/lib/server.mjs
CHANGED
|
@@ -4685,6 +4685,49 @@ function renderNudge(payload) {
|
|
|
4685
4685
|
},
|
|
4686
4686
|
)
|
|
4687
4687
|
|
|
4688
|
+
// relabel_record_people — put a real name where a text record names its person by a bare phone number
|
|
4689
|
+
// (records filed before desktop 0.1.40 could not read Contacts). Owner-only; labels, never identifiers or
|
|
4690
|
+
// message bodies; dry run unless apply: true; the server keeps each before-state in record history.
|
|
4691
|
+
server.registerTool(
|
|
4692
|
+
'relabel_record_people',
|
|
4693
|
+
{
|
|
4694
|
+
title: 'Put a name on texts that show a bare phone number',
|
|
4695
|
+
description:
|
|
4696
|
+
'On YOUR OWN text-message records, replace a bare phone number standing as a person\'s name ("1 message with ' +
|
|
4697
|
+
'+18015550100") with the name you give: the summary, the thread label and the "who:" speaker prefix of each ' +
|
|
4698
|
+
'message. Never changes the number itself as an identifier, message wording, or who can see the record. ' +
|
|
4699
|
+
'Dry run by default (reports how many records would change); pass apply: true to write. Safe to repeat.',
|
|
4700
|
+
inputSchema: {
|
|
4701
|
+
mappings: z.array(z.object({
|
|
4702
|
+
phone: z.string().describe('E.164, e.g. +18015550100 (a "phone:" prefix is fine)'),
|
|
4703
|
+
name: z.string().describe('the display name to show instead'),
|
|
4704
|
+
})).min(1).max(50).describe('one or more number → name pairs'),
|
|
4705
|
+
apply: z.boolean().optional().describe('true = write; omitted/false = dry run'),
|
|
4706
|
+
},
|
|
4707
|
+
},
|
|
4708
|
+
async ({ mappings, apply }) => {
|
|
4709
|
+
let res
|
|
4710
|
+
try {
|
|
4711
|
+
res = await fetchCortex(`${BASE}/api/records/relabel-people`, {
|
|
4712
|
+
method: 'POST',
|
|
4713
|
+
headers: { Authorization: `Bearer ${TOKEN}`, 'Content-Type': 'application/json' },
|
|
4714
|
+
body: JSON.stringify({ mappings, dry_run: apply !== true }),
|
|
4715
|
+
})
|
|
4716
|
+
} catch (e) {
|
|
4717
|
+
return toolError(`Could not reach Agnoclast: ${e.message}`)
|
|
4718
|
+
}
|
|
4719
|
+
const body = await res.json().catch(() => ({}))
|
|
4720
|
+
if (res.status === 404 && !body?.error) return toolError('This server does not relabel records yet. Nothing was written.')
|
|
4721
|
+
if (res.status === 422) return toolError(`Not done: ${body?.detail ?? 'the mappings were refused'}.`)
|
|
4722
|
+
if (!res.ok || !body?.ok) return toolError(`Could not relabel: HTTP ${res.status} ${JSON.stringify(body)}`)
|
|
4723
|
+
const ids = (body.recordIds ?? []).join(', ')
|
|
4724
|
+
const text = body.dryRun
|
|
4725
|
+
? `Dry run: ${body.changed} of your text records would be relabelled (${body.matched} mention the number${body.matched === 1 ? '' : 's'}).${ids ? ` Records: ${ids}.` : ''} Nothing was written; pass apply: true to write.`
|
|
4726
|
+
: `Relabelled ${body.changed} of your text records.${ids ? ` Records: ${ids}.` : ''} Each before-state is kept in record history.`
|
|
4727
|
+
return { content: [{ type: 'text', text }] }
|
|
4728
|
+
},
|
|
4729
|
+
)
|
|
4730
|
+
|
|
4688
4731
|
// ── the questions agents used to answer with SQL (Agnoclast page "Agent SQL gap", 2026-10-07) ──────
|
|
4689
4732
|
// Theron, 2026-10-07: "any information that I have felt the need to get about my own brains, but was
|
|
4690
4733
|
// not able to do it with Agnoclast tools … we either need to make tools for that, or …". Measured the
|
package/package.json
CHANGED