@sura_ai/mcp-server 0.1.31 → 0.1.32
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/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -67,7 +67,7 @@ Block ID: ${$.blockId}`}function IY($){if(!$.success)return`Replace failed: ${$.
|
|
|
67
67
|
`)}function QY($){if(!$.success)return $.error??"append_matrix_rows failed";return`[matrix rows appended | id=${$.matrixId??""}, added=${$.addedRowCount??0}, totalRows=${$.newRowCount??0}, version=${$.newVersion??0}]`}function OY($){if(!$.success)return $.error??"update_matrix_rows failed";let I=$.updatedRowIndices??[],b=`[matrix rows updated | id=${$.matrixId??""}, rows=${$.updatedRowCount??I.length}, version=${$.newVersion??0}]`;if(I.length===0)return b;return[b,`{rowIndex}[${I.length}]:`,...I.map((D)=>M$([D]))].join(`
|
|
68
68
|
`)}function YY($){if(!$.success)return $.error??"delete_matrix_rows failed";let I=$.deletedRowIndices??[],b=`[matrix rows deleted | id=${$.matrixId??""}, removed=${$.deletedRowCount??I.length}, remainingRows=${$.newRowCount??0}, version=${$.newVersion??0}]`;if(I.length===0)return b;return[b,`{rowIndex}[${I.length}]:`,...I.map((D)=>M$([D]))].join(`
|
|
69
69
|
`)}function BY($){if(!$.success)return $.error??"rebind_matrix_to_node failed";let I=$.previousNodeRef??"(body)",b=$.nodeRef??"(body)";return`[matrix rebound | id=${$.matrixId??""}, record=${$.recordId??""}, ${I} → ${b}, version=${$.newVersion??0}]`}function AY($){if(!$.success)return $.error??"delete_matrix failed";let I=$.blockDeleted?`block=${$.blockId??"(found)"} removed`:"block: none found (already detached)";return`[matrix deleted | id=${$.matrixId??""}, owner=${$.entityType??""}:${$.entityId??""}, ${I}]`}function vY($){if(!$.success)return $.error??"attach_matrix failed";let I=`${$.entityType??""}:${$.entityId??""}`,b=$.nodeRef?`, node=${$.nodeRef}`:"";return`[matrix attached | id=${$.matrixId??""}, owner=${I}${b}, version=${$.newVersion??0}]`}function zY($){if(!$.success)return $.error??"list_matrix_references failed";let I=$.references??[];if(I.length===0)return`[matrix_references: id=${$.matrixId}, count=0] no embeds — safe to delete.`;let b=[`[matrix_references: id=${$.matrixId}, count=${I.length}]`,`{sourceType,sourceId,sourceTitle}[${I.length}]:`],D=I.map((U)=>M$([U.sourceType,U.sourceId,U.sourceTitle??""]));return[...b,...D].join(`
|
|
70
|
-
`)}function zL($){return $.map((I)=>{let b=[I.label,I.type];if(I.unit)b.push(I.unit);return`${I.key}(${b.join("/")})`}).join("|")}function JY($){if(!$.success)return $.error??"list_procedure_nodes failed";let I=$.nodes??[],b=$.orphanedMatrices??[],D=[`[procedure_tree: record=${$.recordId??""}, nodeCount=${I.length}, orphanedMatrices=${b.length}]`],U=[];if(I.length>0){U.push(`{id,parentId,order,type,label,copyable,matrixCount,artifactCount,fileCount}[${I.length}]:`);for(let W of I)U.push(M$([W.id,W.parentId??"",W.order,W.type,W.label,W.copyable?"true":"false",W.matrixCount,W.artifactCount,W.fileCount]))}else U.push("No procedure nodes.");let w=[];for(let W of I){if(!W.matrices||W.matrices.length===0)continue;for(let G of W.matrices)w.push({nodeId:W.id,matrix:G})}let X=[];if(w.length>0){X.push(""),X.push("[attachedMatrices]"),X.push(`{nodeId,matrixId,label,version,rows,cols}[${w.length}]:`);for(let{nodeId:W,matrix:G}of w)X.push(M$([W,G.id,G.label,G.version,G.rowCount,zL(G.columns)]))}let N=[];if(b.length>0)if(N.push(""),N.push("[orphanedMatrices]"),b.some((G)=>G.version!==void 0&&G.columns!==void 0)){N.push(`{id,label,version,rows,cols,updatedAt}[${b.length}]:`);for(let G of b)N.push(M$([G.id,G.label,G.version??"",G.rowCount??"",G.columns?zL(G.columns):"",G.updatedAt]))}else{N.push(`{id,label,updatedAt}[${b.length}]:`);for(let G of b)N.push(M$([G.id,G.label,G.updatedAt]))}return[...D,...U,...X,...N].join(`
|
|
70
|
+
`)}function zL($){return $.map((I)=>{let b=[I.label,I.type];if(I.unit)b.push(I.unit);return`${I.key}(${b.join("/")})`}).join("|")}function JY($){if(!$.success)return $.error??"list_procedure_nodes failed";let I=$.nodes??[],b=$.orphanedMatrices??[],D=[`[procedure_tree: record=${$.recordId??""}, nodeCount=${I.length}, orphanedMatrices=${b.length}]`],U=[];if(I.length>0){U.push(`{id,parentId,order,type,label,copyable,matrixCount,artifactCount,fileCount,proseBlockCount}[${I.length}]:`);for(let W of I)U.push(M$([W.id,W.parentId??"",W.order,W.type,W.label,W.copyable?"true":"false",W.matrixCount,W.artifactCount,W.fileCount,W.proseBlockCount]))}else U.push("No procedure nodes.");let w=[];for(let W of I){if(!W.matrices||W.matrices.length===0)continue;for(let G of W.matrices)w.push({nodeId:W.id,matrix:G})}let X=[];if(w.length>0){X.push(""),X.push("[attachedMatrices]"),X.push(`{nodeId,matrixId,label,version,rows,cols}[${w.length}]:`);for(let{nodeId:W,matrix:G}of w)X.push(M$([W,G.id,G.label,G.version,G.rowCount,zL(G.columns)]))}let N=[];if(b.length>0)if(N.push(""),N.push("[orphanedMatrices]"),b.some((G)=>G.version!==void 0&&G.columns!==void 0)){N.push(`{id,label,version,rows,cols,updatedAt}[${b.length}]:`);for(let G of b)N.push(M$([G.id,G.label,G.version??"",G.rowCount??"",G.columns?zL(G.columns):"",G.updatedAt]))}else{N.push(`{id,label,updatedAt}[${b.length}]:`);for(let G of b)N.push(M$([G.id,G.label,G.updatedAt]))}return[...D,...U,...X,...N].join(`
|
|
71
71
|
`)}var zZ=Y.enum(["preamble","full"]),HY=Y.object({entityId:Y.string().describe('Entity ID (UUID or short ref like "lit-a3f7e2b9")'),overview:Y.preprocess(($)=>{if(typeof $==="string")return $==="true";return $},Y.boolean()).optional().describe("Return overview with TOC and preview. Default behavior."),blockIds:Y.array(Y.string()).optional().describe("Array of specific block IDs to fetch from search results"),segment:zZ.optional().describe('Named content region to fetch. Use "preamble" for content before the first heading, or "full" for the entire entity content.'),section:Y.string().optional().describe('Section heading text, blockId, or parent-qualified path (e.g., "Methods/Key Takeaways") to fetch all blocks from'),refs:Y.array(Y.number().int()).optional().describe("Reference numbers to fetch (e.g., [42, 43])"),figures:Y.array(Y.string()).optional().describe('Figure IDs to fetch (e.g., ["fig-1", "fig-2"])'),tables:Y.array(Y.string()).optional().describe('Table IDs to fetch (e.g., ["table-1"])'),node:Y.string().optional().describe("Procedure node label or ID. Returns node prose, matrices (TOON format), artifact links, and child summaries. Records only."),depth:Y.number().int().min(0).optional().describe("Depth: 0 = only direct content (no children), 1 = include immediate children, undefined = all descendants (default). Used with section or node parameter."),from_section:Y.string().optional().describe('Start section heading, blockId, or parent-qualified path (e.g., "Parent/Section") for range fetching (inclusive). Use with to_section.'),to_section:Y.string().optional().describe('End section heading, blockId, or parent-qualified path (e.g., "Parent/Section") for range fetching (inclusive). Use with from_section.'),connections:Y.preprocess(($)=>{if(typeof $==="string")return $==="true";return $},Y.boolean()).optional().describe("Return entity connections (graph edges). Shows which entities mention, cite, or annotate this entity and vice versa. Included automatically as a summary in overview mode.")}),kU={name:"get_content",description:'Fetch content from literature, documents, or records. Returns markdown text.\nAccepts full UUIDs or short entity reference IDs (e.g., `lit-a3f7e2b9`, `doc-9bk4x1f2`, `rec-f72mn3a8`, `art-4c2e19af`).\n\n**Modes:**\n1. **Overview** (default): Preview + table of contents with section headings and estimated tokens. For records, also includes the procedure tree showing nodes, matrices, and artifact links.\n2. **Named Regions**: Pass `segment="preamble"` to fetch content before the first heading, or `segment="full"` to fetch the full entity content.\n3. **Section**: Pass `section="Heading Name"` to get all blocks in that section as interleaved markdown.\n4. **Node** (records only): Pass `node="step label"` to get procedure node content - prose, matrices (TOON format), artifacts, and child summaries. Use `depth` to control child expansion.\n5. **Block IDs**: Pass `blockIds=["id1","id2"]` to fetch specific blocks from search results.\n6. **Refs**: Pass `refs=[42,43]` to fetch literature references by number.\n7. **Figures**: Pass `figures=["fig-1"]` to fetch figure blocks.\n8. **Tables**: Pass `tables=["table-1"]` to fetch table blocks.\n9. **Section range**: Pass `from_section` and `to_section` to fetch all content between two headings (inclusive).\n10. **Section with depth**: Pass `section` with `depth=0` for own content only, `depth=1` for immediate children.\n11. **Connections**: Pass `connections=true` to get all entity connections (mentions, citations, annotation edges). Included automatically in overview mode as a summary. Annotation edges include edge text explaining the relationship.\n\n**Interleaved Format (Section mode):**\nSection mode returns content with block IDs embedded for editing:\n```\n[paragraph | dff74a60-0dd9-4cfa-9ae1-04c462d5cf46]\nThis is the paragraph content...\n\n[heading:2 | a9fe6c59-cf59-495c-b688-a6fcfb605491]\n## Methods\n```\nUse these block IDs with `str_replace_block`, `insert_block`, or `delete_block`.\n\n**Reading Strategy:** Check `ownTokens` and `children` in TOC entries:\n- If `ownTokens` is 0 and `children` exists -> container heading, fetch children individually\n- If `children` is absent -> leaf section, fetch directly with `section`\n- `estimatedTokens` = total tokens including all descendants\n- If `overview.regions` is present, use the provided `retrievalHint` to fetch non-TOC content such as opening paragraphs or heading-less documents\n\n**Best Practice:** Check `estimatedTokens` in TOC before fetching large sections.'};var LY=Y.object({forceRefresh:Y.boolean().optional().describe("Force reload from server instead of returning cached context. Use after creating new organizations or workspaces.")}),SU={name:"get_workspace_context",description:"Get the user's organizational hierarchy: organizations, workspaces, and spaces. Returns default orgId and workspaceId for use with other tools (search, create_document, etc.). Called automatically at startup; use forceRefresh=true to reload if the user creates new workspaces mid-session."};var DN=Y.object({entityType:m6.describe('Entity type: "document" or "record"'),entityId:Y.string().uuid().describe("Document or record ID"),afterBlockId:Y.string().optional().describe("Insert AFTER this block ID (sibling insertion)"),beforeBlockId:Y.string().optional().describe("Insert BEFORE this block ID (sibling insertion)"),parentBlockId:Y.string().optional().describe("Insert as CHILD of this container block (e.g., add referenceItem inside referenceList)"),childPosition:Y.string().optional().describe('Position within parent children: "first", "last" (default), or child block ID to insert after'),blockType:Y.enum(eX).default("paragraph").optional().describe("Type of block to create. Default: paragraph"),content:Y.string().optional().describe("Text content for the new block"),headingLevel:Y.number().int().min(1).max(3).optional().describe("Heading level (1-3) if blockType is heading"),checked:Y.boolean().optional().describe("Checked state for checkListItem"),title:Y.string().optional().describe('Title for referenceList container (default: "References")'),refNumber:Y.number().int().min(1).optional().describe("Reference number for referenceItem (e.g., 1, 2, 3)"),refId:Y.string().optional().describe('Stable ref ID for citation linking (e.g., "lit-a3f7e2b9"). Auto-generated from linkedEntityId if omitted.'),refType:Y.enum(sX).optional().describe("Type of reference: literature, document, record, or annotation"),linkedEntityId:Y.string().uuid().optional().describe("UUID of the linked entity (literature, document, or record)"),entityTitle:Y.string().optional().describe("Cached title of the linked entity"),doi:Y.string().optional().describe("DOI for literature references"),smiles:Y.string().optional().describe('SMILES string (e.g., "CCO" for ethanol). Required for molecule blocks.'),structureType:Y.enum($N).optional().describe('Structure type for molecule blocks: "molecule" (default) or "reaction"'),moleculeName:Y.string().optional().describe("Name of the molecule or reaction"),moleculeDescription:Y.string().optional().describe("Optional description or notes for the molecule block"),matrixId:Y.string().optional().describe("UUID of the linked data matrix for structuredMatrix blocks"),nodeRef:Y.string().optional().describe("Procedure tree node ID for structuredMatrix blocks"),matrixLabel:Y.string().optional().describe("Display label for structuredMatrix blocks"),showPreview:Y.boolean().optional().describe("Whether structuredMatrix should show its inline preview"),blocks:Y.array(TO).max(XI).optional().describe(`Array of blocks to insert in sequence. Max ${XI} blocks. Use this for inserting multiple blocks in one call.`)}),JZ=DN.refine(($)=>{return[$.afterBlockId,$.beforeBlockId,$.parentBlockId].filter(Boolean).length<=1},{message:"Use only one positioning mode: afterBlockId, beforeBlockId, OR parentBlockId"}).refine(($)=>{if($.childPosition&&!$.parentBlockId)return!1;return!0},{message:"childPosition can only be used with parentBlockId"}).refine(($)=>{let I=$.content!==void 0,b=$.blocks!==void 0&&$.blocks.length>0;return I!==b},{message:"Provide either content (single block) or blocks (batch), not both"}),PU={name:"insert_block",description:`Insert block(s) in a document. Three positioning modes:
|
|
72
72
|
1. afterBlockId: Insert as SIBLING after the specified block
|
|
73
73
|
2. beforeBlockId: Insert as SIBLING before the specified block
|