@limeadelabs/clarabit-mcp 2.1.0 → 2.2.0

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 +33 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -99,9 +99,10 @@ var ClarabitClient = class {
99
99
  createPage(projectId, title, body) {
100
100
  return this.request("POST", `/projects/${projectId}/pages`, { page: { title, body } });
101
101
  }
102
- updatePage(projectId, pageId, updates, changeSummary) {
102
+ updatePage(projectId, pageId, updates, changeSummary, verbose) {
103
103
  const body = { page: updates };
104
104
  if (changeSummary !== void 0) body.change_summary = changeSummary;
105
+ if (verbose !== void 0) body.verbose = verbose;
105
106
  return this.request("PATCH", `/projects/${projectId}/pages/${pageId}`, body);
106
107
  }
107
108
  listPageVersions(projectId, pageId) {
@@ -130,9 +131,10 @@ var ClarabitClient = class {
130
131
  getPageFlat(pageId) {
131
132
  return this.request("GET", `/pages/${pageId}`);
132
133
  }
133
- updatePageFlat(pageId, updates, changeSummary) {
134
+ updatePageFlat(pageId, updates, changeSummary, verbose) {
134
135
  const body = { page: updates };
135
136
  if (changeSummary !== void 0) body.change_summary = changeSummary;
137
+ if (verbose !== void 0) body.verbose = verbose;
136
138
  return this.request("PATCH", `/pages/${pageId}`, body);
137
139
  }
138
140
  listPageVersionsFlat(pageId) {
@@ -159,6 +161,13 @@ var ClarabitClient = class {
159
161
  `/projects/${projectId}/pages/${pageId}/comments${query}`
160
162
  );
161
163
  }
164
+ listPageCommentsFlat(pageId, opts) {
165
+ const query = opts?.resolved === void 0 ? "" : `?resolved=${opts.resolved ? "true" : "false"}`;
166
+ return this.request(
167
+ "GET",
168
+ `/pages/${pageId}/comments${query}`
169
+ );
170
+ }
162
171
  createPageComment(projectId, pageId, body, opts) {
163
172
  return this.request(
164
173
  "POST",
@@ -551,20 +560,21 @@ function registerPageTools(server2, client2) {
551
560
  );
552
561
  server2.tool(
553
562
  "cla_update_page",
554
- "Update an existing spec/doc page in a Clarabit project. Every MCP edit creates a new PageVersion (no debounce). Optionally pass change_summary to label the snapshot.",
563
+ "Update an existing spec/doc page in a Clarabit project. Every MCP edit creates a new PageVersion (no debounce). Optionally pass change_summary to label the snapshot. Returns a minimal confirmation by default (id, title, version_number, change_summary) \u2014 pass verbose: true if you actually need the full body back (rare; the agent typically just sent it).",
555
564
  {
556
565
  project_id: z7.coerce.number().optional().describe("Project ID (optional \u2014 inferred if omitted)"),
557
566
  page_id: z7.coerce.number().describe("Page ID"),
558
567
  title: z7.string().optional().describe("New page title (optional)"),
559
568
  body: z7.string().optional().describe("New page body in markdown (optional)"),
560
- change_summary: z7.string().optional().describe("Short note describing why this edit was made (shown in version history)")
569
+ change_summary: z7.string().optional().describe("Short note describing why this edit was made (shown in version history)"),
570
+ verbose: z7.boolean().optional().describe("Return the full page (including body) in the response. Default false \u2014 saves round-trip cost on long pages.")
561
571
  },
562
572
  async (params) => {
563
573
  try {
564
574
  const updates = {};
565
575
  if (params.title) updates.title = params.title;
566
576
  if (params.body) updates.body = params.body;
567
- const result = params.project_id ? await client2.updatePage(params.project_id, params.page_id, updates, params.change_summary) : await client2.updatePageFlat(params.page_id, updates, params.change_summary);
577
+ const result = params.project_id ? await client2.updatePage(params.project_id, params.page_id, updates, params.change_summary, params.verbose) : await client2.updatePageFlat(params.page_id, updates, params.change_summary, params.verbose);
568
578
  return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
569
579
  } catch (error) {
570
580
  return handleError(error, client2.timeoutMs);
@@ -651,6 +661,24 @@ function registerPageTools(server2, client2) {
651
661
  // src/tools/page-comments.ts
652
662
  import { z as z8 } from "zod";
653
663
  function registerPageCommentTools(server2, client2) {
664
+ server2.tool(
665
+ "cla_list_page_comments",
666
+ "List comments on a page. Returns root comments with their threaded replies. Use the resolved filter to focus on open threads (resolved=false) or only the resolved ones (resolved=true). Pass project_id to use the nested route; omit it and the server resolves the page via the api key\u2019s accessible_pages scope.",
667
+ {
668
+ page_id: z8.coerce.number().describe("Page ID to list comments for"),
669
+ project_id: z8.coerce.number().optional().describe("Project ID (optional \u2014 omit to use the flat route)"),
670
+ resolved: z8.boolean().optional().describe("Filter: true returns only resolved comments, false returns only unresolved")
671
+ },
672
+ async (params) => {
673
+ try {
674
+ const opts = params.resolved === void 0 ? void 0 : { resolved: params.resolved };
675
+ const result = params.project_id === void 0 ? await client2.listPageCommentsFlat(params.page_id, opts) : await client2.listPageComments(params.project_id, params.page_id, opts);
676
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
677
+ } catch (error) {
678
+ return handleError(error, client2.timeoutMs);
679
+ }
680
+ }
681
+ );
654
682
  server2.tool(
655
683
  "cla_create_page_comment",
656
684
  "Post a comment on a page. Optionally thread under another comment via parent_comment_id, or anchor to a text selection via anchor_text/anchor_start/anchor_end.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limeadelabs/clarabit-mcp",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "Clarabit MCP server for Claude Code — AI-native project management integration",
5
5
  "type": "module",
6
6
  "exports": {