@sodiumhq/mcp-pm 0.1.0-beta.2771 → 0.1.0-beta.2772

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.
Files changed (2) hide show
  1. package/dist/index.js +53 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2971,6 +2971,49 @@ async function handleCreateClient(api, args) {
2971
2971
  }
2972
2972
  }
2973
2973
  //#endregion
2974
+ //#region ../mcp-core/src/tools/get-contact.ts
2975
+ const GetContactInputSchema = { contactCode: z.string().min(1, "Contact code is required").describe("The contact code (identifier). Discoverable via list_contacts or the contacts section of get_client_summary.") };
2976
+ async function handleGetContact(api, args) {
2977
+ try {
2978
+ const c = await api.getContact(args.contactCode);
2979
+ const lines = [];
2980
+ const name = [
2981
+ c.title,
2982
+ c.firstName,
2983
+ c.middleName,
2984
+ c.lastName
2985
+ ].filter(Boolean).join(" ") || "(no name)";
2986
+ lines.push(`Contact: ${name} (${c.code ?? args.contactCode})`);
2987
+ if (c.email) lines.push(`Email: ${c.email}`);
2988
+ if (c.phone) lines.push(`Phone: ${c.phone}`);
2989
+ if (c.mobile) lines.push(`Mobile: ${c.mobile}`);
2990
+ if (c.address) lines.push(`Address: ${c.address}`);
2991
+ if (c.dateOfBirth) lines.push(`Date of birth: ${c.dateOfBirth}`);
2992
+ if (c.nationality) lines.push(`Nationality: ${c.nationality}`);
2993
+ if (c.maritalStatus) lines.push(`Marital status: ${c.maritalStatus}`);
2994
+ if (c.utr) lines.push(`UTR: ${c.utr}`);
2995
+ if (c.niNumber) lines.push(`NI number: ${c.niNumber}`);
2996
+ if (c.personalCode) lines.push(`Companies House person code: ${c.personalCode}`);
2997
+ if (c.isDeceased) lines.push(`Deceased: yes${c.deceasedDate ? ` (${c.deceasedDate})` : ""}`);
2998
+ if (c.clientCount !== void 0) lines.push(`Linked to ${c.clientCount} client(s)`);
2999
+ if (c.client) lines.push(`Primary client: ${c.client.name} (${c.client.code})`);
3000
+ if (c.individualClient) lines.push(`Individual client record: ${c.individualClient.name} (${c.individualClient.code})`);
3001
+ if (c.portalUser) lines.push(`Portal user: ${c.portalUser.name} (${c.portalUser.code})`);
3002
+ return { content: [{
3003
+ type: "text",
3004
+ text: lines.join("\n")
3005
+ }] };
3006
+ } catch (error) {
3007
+ return {
3008
+ content: [{
3009
+ type: "text",
3010
+ text: error instanceof SodiumApiError ? `Error getting contact: ${error.message} (correlation: ${error.correlationId})` : `Error getting contact: ${error instanceof Error ? error.message : String(error)}`
3011
+ }],
3012
+ isError: true
3013
+ };
3014
+ }
3015
+ }
3016
+ //#endregion
2974
3017
  //#region ../mcp-core/src/tools/list-client-notes.ts
2975
3018
  const sortFieldEnum$1 = z.enum(["Date", "UpdatedDate"]);
2976
3019
  const ListClientNotesInputSchema = {
@@ -3350,6 +3393,16 @@ async function buildServer(config) {
3350
3393
  openWorldHint: true
3351
3394
  }
3352
3395
  }, (args) => handleListContacts(api, args));
3396
+ server.registerTool("get_contact", {
3397
+ title: "Get full details of a contact",
3398
+ description: "Get all fields for a single contact by code: name, title, email, phone, mobile, address, date of birth, nationality, marital status, UTR, NI number, Companies House person code, deceased status, linked clients, and portal user. Use after list_contacts identifies the contact of interest, or when the user asks for details about a specific contact. Also useful before update_contact to see current values.",
3399
+ inputSchema: GetContactInputSchema,
3400
+ annotations: {
3401
+ readOnlyHint: true,
3402
+ idempotentHint: true,
3403
+ openWorldHint: true
3404
+ }
3405
+ }, (args) => handleGetContact(api, args));
3353
3406
  registerWriteTool(server, config.context, "add_task_note", {
3354
3407
  title: "Add a note to a task",
3355
3408
  description: "Create a new note on a task. Additive — does not modify or delete existing notes. The note is attributed to the authenticated API user (the current practice member) and timestamped to 'now'. Use this when the user asks you to capture something on a task: 'add a note on the Greggs year-end task that we're waiting on the rental schedule', 'log on the task that I called John today and got voicemail'. Notes can be pinned; only pin when the user explicitly asks for it. The user can always edit or delete notes in the Sodium UI if the wording isn't right.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sodiumhq/mcp-pm",
3
- "version": "0.1.0-beta.2771",
3
+ "version": "0.1.0-beta.2772",
4
4
  "description": "Sodium Practice Management MCP server — lets AI assistants interact with your Sodium tenant",
5
5
  "type": "module",
6
6
  "bin": {