xlsx-for-ai 2.3.0 → 2.5.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.
- package/mcp.js +48 -2
- package/package.json +1 -1
package/mcp.js
CHANGED
|
@@ -525,6 +525,45 @@ const TOOLS = [
|
|
|
525
525
|
required: ['file_path'],
|
|
526
526
|
},
|
|
527
527
|
},
|
|
528
|
+
|
|
529
|
+
{
|
|
530
|
+
name: 'xlsx_conditional_formats',
|
|
531
|
+
description:
|
|
532
|
+
'xlsx-for-ai — read, write, diff, redact, supervise .xlsx files locally.\n' +
|
|
533
|
+
'This tool: list every conditional formatting rule in a workbook — color scales, data bars, icon sets, formula-based highlights, top-N, duplicate / unique values, contains-text, time-period, above-average. Per rule: range, type, operator, formulae, priority, stopIfTrue.\n' +
|
|
534
|
+
'No other tool can do this: pandas drops conditional formatting on read entirely; openpyxl exposes the raw CF objects but offers no rollup or classification. This surfaces every rule plus a per-type tally so an agent can answer "does this workbook use color scales?" without scanning every row.\n\n' +
|
|
535
|
+
'USE WHEN: auditing a dashboard / financial model to know what visual cues a human would see. Or extracting business rules embedded as CF (e.g. "row turns red when col C > 1000" — the rule IS the spec). Or generating fixtures that match a workbook\'s CF semantics. ' +
|
|
536
|
+
'Free tier — counts against the 10k/mo cap.\n\n' +
|
|
537
|
+
'DO NOT USE WHEN: you only care about cell values (use xlsx_read). Or you want to re-apply CF rules to a NEW workbook (xlsx_write does not write CF rules).',
|
|
538
|
+
inputSchema: {
|
|
539
|
+
type: 'object',
|
|
540
|
+
properties: {
|
|
541
|
+
file_path: { type: 'string', description: 'Absolute path to the .xlsx file.' },
|
|
542
|
+
sheet: { type: 'string', description: 'Optional: restrict to a specific sheet.' },
|
|
543
|
+
},
|
|
544
|
+
required: ['file_path'],
|
|
545
|
+
},
|
|
546
|
+
},
|
|
547
|
+
|
|
548
|
+
{
|
|
549
|
+
name: 'xlsx_styles',
|
|
550
|
+
description:
|
|
551
|
+
'xlsx-for-ai — read, write, diff, redact, supervise .xlsx files locally.\n' +
|
|
552
|
+
'This tool: surface cell formatting (number formats, fonts, fills, alignment) so an agent knows what a cell LOOKS like, not just its raw value. Default mode: per-sheet rollup of top-N number formats / fonts / fills with counts. Detailed mode (opt-in, capped at 1000 cells): per-cell breakdown for narrow queries.\n' +
|
|
553
|
+
'No other tool can do this with this fidelity: pandas drops styles on read entirely. The single most valuable slice is number formats — pandas hands an LLM "45292" and the cell rendered as "2024-01-01" because format was "yyyy-mm-dd". xlsx_styles is what makes that recoverable.\n\n' +
|
|
554
|
+
'USE WHEN: an LLM is about to interpret raw numbers (date serials, currency, percents, scientific notation) and you want the format hint that tells it what those numbers MEAN to a human. Or auditing a dashboard\'s typography. Or fingerprinting a template. ' +
|
|
555
|
+
'Free tier — counts against the 10k/mo cap.\n\n' +
|
|
556
|
+
'DO NOT USE WHEN: you only need the data (use xlsx_read which already includes basic numFmt hints in the output).',
|
|
557
|
+
inputSchema: {
|
|
558
|
+
type: 'object',
|
|
559
|
+
properties: {
|
|
560
|
+
file_path: { type: 'string', description: 'Absolute path to the .xlsx file.' },
|
|
561
|
+
sheet: { type: 'string', description: 'Optional: restrict to a specific sheet.' },
|
|
562
|
+
detailed: { type: 'boolean', description: 'If true, return per-cell breakdown (capped at 1000 cells). Default false (per-sheet rollup).' },
|
|
563
|
+
},
|
|
564
|
+
required: ['file_path'],
|
|
565
|
+
},
|
|
566
|
+
},
|
|
528
567
|
];
|
|
529
568
|
|
|
530
569
|
// ---------------------------------------------------------------------------
|
|
@@ -738,10 +777,17 @@ async function dispatchTool(name, args) {
|
|
|
738
777
|
});
|
|
739
778
|
}
|
|
740
779
|
|
|
741
|
-
// All other tools (list_sheets, schema
|
|
780
|
+
// All other tools (list_sheets, schema, hyperlinks, conditional_formats,
|
|
781
|
+
// styles, etc.) — single-file relay. Forward any common option keys the
|
|
782
|
+
// routes accept so we don't silently drop them. New keys added here as
|
|
783
|
+
// tools start accepting them; the server tolerates extras.
|
|
784
|
+
const opts = {};
|
|
785
|
+
if (args.sheet !== undefined) opts.sheet = args.sheet;
|
|
786
|
+
if (args.limit !== undefined) opts.limit = args.limit;
|
|
787
|
+
if (args.detailed !== undefined) opts.detailed = args.detailed;
|
|
742
788
|
const body = {
|
|
743
789
|
file_b64: fileToB64(args.file_path),
|
|
744
|
-
options:
|
|
790
|
+
options: opts,
|
|
745
791
|
};
|
|
746
792
|
return callTool(name, body);
|
|
747
793
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xlsx-for-ai",
|
|
3
3
|
"mcpName": "io.github.senoff/xlsx-for-ai",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.5.0",
|
|
5
5
|
"description": "The MCP server that makes LLMs reliable on real-world Excel spreadsheets. Thin npm client over a hosted API — read, write, diff, redact, and supervise .xlsx files from any MCP-aware agent.",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"bin": {
|