@chaprola/mcp-server 1.1.0 → 1.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 +40 -0
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -489,6 +489,46 @@ server.tool("chaprola_merge", "Merge two sorted data files into one. Both must s
489
489
  const res = await authedFetch("/merge", { userid: username, project, file_a, file_b, output, key });
490
490
  return textResult(res);
491
491
  }));
492
+ // --- Schema: Format + Alter ---
493
+ server.tool("chaprola_format", "Inspect a data file's schema — returns field names, positions, lengths, types, and PHI flags", {
494
+ project: z.string().describe("Project name"),
495
+ name: z.string().describe("Data file name (without .F extension)"),
496
+ }, async ({ project, name }) => withBaaCheck(async () => {
497
+ const { username } = getCredentials();
498
+ const res = await authedFetch("/format", { userid: username, project, name });
499
+ return textResult(res);
500
+ }));
501
+ server.tool("chaprola_alter", "Modify a data file's schema: widen/narrow/rename fields, add new fields, drop fields. Transforms existing data to match the new schema.", {
502
+ project: z.string().describe("Project name"),
503
+ name: z.string().describe("Data file name (without extension)"),
504
+ alter: z.array(z.object({
505
+ field: z.string().describe("Field name to modify"),
506
+ width: z.number().optional().describe("New width (widen or narrow)"),
507
+ rename: z.string().optional().describe("New field name"),
508
+ type: z.enum(["text", "numeric"]).optional().describe("Change field type"),
509
+ })).optional().describe("Fields to alter"),
510
+ add: z.array(z.object({
511
+ name: z.string().describe("New field name"),
512
+ width: z.number().describe("Field width"),
513
+ type: z.enum(["text", "numeric"]).optional().describe("Field type (default: text)"),
514
+ after: z.string().optional().describe("Insert after this field (default: end)"),
515
+ })).optional().describe("Fields to add"),
516
+ drop: z.array(z.string()).optional().describe("Field names to drop"),
517
+ output: z.string().optional().describe("Output file name (default: in-place)"),
518
+ }, async ({ project, name, alter, add, drop, output }) => withBaaCheck(async () => {
519
+ const { username } = getCredentials();
520
+ const body = { userid: username, project, name };
521
+ if (alter)
522
+ body.alter = alter;
523
+ if (add)
524
+ body.add = add;
525
+ if (drop)
526
+ body.drop = drop;
527
+ if (output)
528
+ body.output = output;
529
+ const res = await authedFetch("/alter", body);
530
+ return textResult(res);
531
+ }));
492
532
  // --- Optimize (HULDRA) ---
493
533
  server.tool("chaprola_optimize", "Run HULDRA nonlinear optimization using a compiled .PR as the objective evaluator", {
494
534
  project: z.string().describe("Project name"),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chaprola/mcp-server",
3
- "version": "1.1.0",
4
- "description": "MCP server for Chaprola — agent-first data platform. Gives AI agents 40 tools for structured data storage, querying, web search, URL fetching, scheduled jobs, and execution via plain HTTP.",
3
+ "version": "1.2.0",
4
+ "description": "MCP server for Chaprola — agent-first data platform. Gives AI agents 42 tools for structured data storage, querying, schema inspection, web search, URL fetching, scheduled jobs, and execution via plain HTTP.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "bin": {