@tiwater/office-mcp 0.15.2 → 0.15.3
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/_shared/tool-runtime.mjs
CHANGED
|
@@ -8,8 +8,9 @@ import { spawn } from 'node:child_process';
|
|
|
8
8
|
const sharedDir = path.dirname(fileURLToPath(import.meta.url));
|
|
9
9
|
export const repoRoot = path.resolve(sharedDir, '..', '..');
|
|
10
10
|
|
|
11
|
-
export function createToolResult(payload) {
|
|
11
|
+
export function createToolResult(payload, { isError = false } = {}) {
|
|
12
12
|
return {
|
|
13
|
+
...(isError ? { isError: true } : {}),
|
|
13
14
|
structuredContent: payload,
|
|
14
15
|
content: [
|
|
15
16
|
{
|
package/office/README.md
CHANGED
|
@@ -27,6 +27,9 @@ Each mutation tool fixes its provider operation type. Callers submit only the
|
|
|
27
27
|
coordinates and values for that action, so they cannot provide an arbitrary
|
|
28
28
|
operation discriminator or a multi-action plan language. A call may batch
|
|
29
29
|
multiple changes only when every change has the same action kind.
|
|
30
|
+
When a completed mutation receipt reports `summary.pass=false`, the MCP result
|
|
31
|
+
also sets the standard `isError` field; consumers do not need a private failure
|
|
32
|
+
interpretation.
|
|
30
33
|
|
|
31
34
|
Structural worksheet row deletion is exposed as `xlsx_delete_rows`. Each change
|
|
32
35
|
contains only `sheet`, `startRow`, and `count`; unsupported dependent workbook
|
package/office/index.mjs
CHANGED
|
@@ -382,7 +382,10 @@ function buildServer() {
|
|
|
382
382
|
...(tool.outputSchema ? { outputSchema: tool.outputSchema } : {}),
|
|
383
383
|
...(tool.annotations ? { annotations: tool.annotations } : {}),
|
|
384
384
|
},
|
|
385
|
-
async args =>
|
|
385
|
+
async args => {
|
|
386
|
+
const payload = await tool.handler(args);
|
|
387
|
+
return createToolResult(payload, { isError: payload?.summary?.pass === false });
|
|
388
|
+
},
|
|
386
389
|
);
|
|
387
390
|
}
|
|
388
391
|
return server;
|