From 6b296e08fc1357c32dbc94686c91cee82c6b97c6 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 1 Dec 2026 11:08:02 +0000 Subject: [PATCH] Add Custom Table tools makerble_list_custom_tables, makerble_get_custom_table (definition plus a page of rows), makerble_list_custom_table_columns, makerble_create_custom_table and makerble_update_custom_table, over the API v2 endpoints in MakerbleDev/makerble#18305 (CP-9393). Tool count 415 -> 420. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01F1a5xnJzuyVMVBjvpcDwaR --- makerble-mcp-vercel-README.md | 4 +- makerble-tools.js | 148 +++++++++++++++++++++++++++++++++- 2 files changed, 149 insertions(+), 3 deletions(-) diff --git a/makerble-mcp-vercel-README.md b/makerble-mcp-vercel-README.md index f5bc887..dfc2b4c 100644 --- a/makerble-mcp-vercel-README.md +++ b/makerble-mcp-vercel-README.md @@ -1,6 +1,6 @@ # Makerble MCP Server — Vercel Deployment -Connects Claude, ChatGPT, and other AI assistants directly to Makerble. Exposes **415 tools** covering the full Makerble API. +Connects Claude, ChatGPT, and other AI assistants directly to Makerble. Exposes **420 tools** covering the full Makerble API. Non-technical users get their personal link from Makerble itself (**User Settings, then AI assistants**), where they choose which organisation its use is billed to, or from **`/connect`** — no curl, no config files, no tokens to hunt down. @@ -11,7 +11,7 @@ Non-technical users get their personal link from Makerble itself (**User Setting | File | Purpose | |---|---| | `server.js` | Express HTTP server — routing, auth, /connect page | -| `makerble-tools.js` | All 415 Makerble API tool definitions | +| `makerble-tools.js` | All 420 Makerble API tool definitions | | `package.json` | Dependencies | | `vercel.json` | Vercel routing config | | `.gitignore` | Keeps secrets and node_modules out of git | diff --git a/makerble-tools.js b/makerble-tools.js index 75bbe99..bc377b3 100644 --- a/makerble-tools.js +++ b/makerble-tools.js @@ -1,6 +1,6 @@ /** * makerble-tools.js - * All 415 Makerble MCP tool definitions. + * All 420 Makerble MCP tool definitions. * Imported by server.js and used by both transports (stdio & HTTP). */ @@ -883,6 +883,152 @@ export function buildTools(api) { }, }, + { + name: "makerble_list_custom_tables", + description: + "List the Custom Tables (CustomListView in the API: a saved column layout for the Contacts list on " + + "Manage Contacts) the user can see: their own, and their organisations' tables shared with them. Returns " + + "each table's id, name, charity_id, owner (User = only its creator sees it; Charity = shared with " + + "colleagues), visibility, can_edit and its columns. Use makerble_get_custom_table for a table's values. " + + "Paginated; use last_synced_datetime for incremental sync.", + inputSchema: { + type: "object", + properties: { + charity_id: { type: "number", description: "Only this organisation's tables." }, + page: { type: "number" }, + per_page: { type: "number", description: "Default 10, max 200." }, + last_synced_datetime: { type: "string", description: "Only tables changed after this ISO 8601 time." }, + }, + }, + handler: (p) => get("/custom_tables", p), + }, + + { + name: "makerble_get_custom_table", + description: + "Read a Custom Table (a saved column layout for the Contacts list): its definition, and one page of its " + + "rows as Manage Contacts shows them — a row per Contact (Beneficiary) the user may see, ordered by Contact " + + "id, with one value per heading in headers. Use it as evidence for a report or to answer questions about " + + "Contacts' attendance, survey answers or progress. Narrow the Contacts with project_ids or album_ids. " + + "Returns { table, rows: { page, page_size, page_count, total_count, headers, data } }; each data row has " + + "contact_id, contact_name and values. Fields hidden from the user read as restricted. A table the user " + + "can't see returns not found.", + inputSchema: { + type: "object", + properties: { + id: { type: "number", description: "The Custom Table's id (from makerble_list_custom_tables)." }, + project_ids: { type: "array", items: { type: "number" }, description: "Only Contacts in any of these Projects." }, + album_ids: { type: "array", items: { type: "number" }, description: "Only Contacts in the Projects of these Albums." }, + page: { type: "number", description: "Page of Contacts, default 1." }, + per_page: { type: "number", description: "Contacts per page, default 10, max 200." }, + }, + required: ["id"], + }, + handler: async ({ id, ...params }) => { + const [table, rows] = await Promise.all([get(`/custom_tables/${id}`), get(`/custom_tables/${id}/rows`, params)]); + return { table, rows }; + }, + }, + + { + name: "makerble_list_custom_table_columns", + description: + "List every column a Custom Table (a saved column layout for the Contacts list) can have in an " + + "organisation, grouped as the Create a table form groups them: basic Contact fields (name, date of birth, " + + "date joined…), Bio Form questions, Survey Questions and Progress Trackers (first and most recent answers " + + "and totals; trackers are Indicators in the API), other information about a Contact (stories, cases, " + + "projects), survey questions with a column per named wave, and relationships. Fields hidden from the user " + + "are left out. Call this before makerble_create_custom_table or makerble_update_custom_table and copy each " + + "chosen column unchanged into columns; only display_name (the heading) may be edited.", + inputSchema: { + type: "object", + properties: { charity_id: { type: "number", description: "The organisation's id." } }, + required: ["charity_id"], + }, + handler: (p) => get("/custom_tables/available_columns", p), + }, + + { + name: "makerble_create_custom_table", + description: + "Create a Custom Table (a saved column layout for the Contacts list on Manage Contacts), as Manage " + + "Contacts › Custom tables › Create a table does. It shows on Manage Contacts straight away. Returns the table.\n" + + "Workflow: (1) makerble_list_custom_tables to check the organisation doesn't already have one like it; " + + "(2) makerble_list_custom_table_columns for the organisation; (3) pick the columns the user asked for, in the " + + "order they want, copying each column object unchanged (you may change display_name); (4) call this tool; " + + "(5) optionally makerble_get_custom_table to show the first rows. A column the organisation doesn't offer, or " + + "one hidden from the user, is refused with an error naming it.", + inputSchema: { + type: "object", + properties: { + charity_id: { type: "number", description: "The organisation the table belongs to." }, + name: { type: "string", description: "The table's title." }, + columns: { + type: "array", + description: "Columns from makerble_list_custom_table_columns, in display order.", + items: { + type: "object", + properties: { + class_name: { type: "string" }, + field_name: { type: "string" }, + field_id: { type: "string" }, + display_name: { type: "string", description: "The column heading." }, + }, + required: ["class_name", "field_name"], + }, + }, + owner: { + type: "string", + enum: ["User", "Charity"], + description: "User (default): only the creator sees it. Charity: shared with colleagues (organisation editors only).", + }, + visibility: { + type: "string", + enum: ["charity_colleagues", "individual_list"], + description: "For a Charity table: every colleague, or only those in individual_list.", + }, + individual_list: { type: "array", items: { type: "number" }, description: "User ids who see an individual_list table." }, + }, + required: ["charity_id", "name"], + }, + handler: (p) => post("/custom_tables", { custom_table: p }), + }, + + { + name: "makerble_update_custom_table", + description: + "Change a Custom Table (a saved column layout for the Contacts list): its name, columns, owner or who sees " + + "it. Only what you send changes; columns replaces all the columns, so send the full list (start from the " + + "table's current columns from makerble_get_custom_table and add or remove). New columns come from " + + "makerble_list_custom_table_columns. Only the table's creator, or an organisation editor for a shared table, " + + "may change it (can_edit in makerble_list_custom_tables). Returns the table.", + inputSchema: { + type: "object", + properties: { + id: { type: "number", description: "The Custom Table's id." }, + name: { type: "string" }, + columns: { + type: "array", + items: { + type: "object", + properties: { + class_name: { type: "string" }, + field_name: { type: "string" }, + field_id: { type: "string" }, + display_name: { type: "string" }, + }, + required: ["class_name", "field_name"], + }, + }, + owner: { type: "string", enum: ["User", "Charity"] }, + visibility: { type: "string", enum: ["charity_colleagues", "individual_list"] }, + individual_list: { type: "array", items: { type: "number" } }, + }, + required: ["id"], + }, + handler: ({ id, ...attributes }) => patch(`/custom_tables/${id}`, { custom_table: attributes }), + }, + { name: "makerble_list_albums", description: