@corsair-dev/mcp 0.1.19 → 0.1.20

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.
@@ -0,0 +1,9 @@
1
+ import type { AnyCorsairInstance } from 'corsair';
2
+ import { formatDocSchemaShape } from 'corsair';
3
+ export { formatDocSchemaShape };
4
+ /**
5
+ * Plain-text schema for a Corsair operation path, with `// description` notes
6
+ * on each top-level input/output field (from Zod `.describe()`).
7
+ */
8
+ export declare function formatGetSchemaResponse(corsair: AnyCorsairInstance, path: string): string;
9
+ //# sourceMappingURL=schema-format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-format.d.ts","sourceRoot":"","sources":["../../src/core/schema-format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAa,MAAM,SAAS,CAAC;AAE1D,OAAO,EAAE,oBAAoB,EAAE,CAAC;AAEhC;;;GAGG;AACH,wBAAgB,uBAAuB,CACtC,OAAO,EAAE,kBAAkB,EAC3B,IAAI,EAAE,MAAM,GACV,MAAM,CAER"}
@@ -1 +1 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/core/tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAGzE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,MAAM,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,CAAC,CAAC,WAAW,CAAC;IACrB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;CACpE,CAAC;AAEF,wBAAgB,oBAAoB,CACnC,OAAO,EAAE,cAAc,GACrB,cAAc,EAAE,CAuLlB"}
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/core/tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAGzE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAGpD,MAAM,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,CAAC,CAAC,WAAW,CAAC;IACrB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;CACpE,CAAC;AAEF,wBAAgB,oBAAoB,CACnC,OAAO,EAAE,cAAc,GACrB,cAAc,EAAE,CA+LlB"}
package/dist/index.js CHANGED
@@ -3,8 +3,16 @@ import { z as z2 } from "zod";
3
3
  import { zodToJsonSchema } from "zod-to-json-schema";
4
4
 
5
5
  // src/core/tools.ts
6
- import { getSchema, listOperations, setupCorsair } from "corsair";
6
+ import { listOperations, setupCorsair } from "corsair";
7
7
  import { z } from "zod";
8
+
9
+ // src/core/schema-format.ts
10
+ import { formatDocSchemaShape, getSchema } from "corsair";
11
+ function formatGetSchemaResponse(corsair, path) {
12
+ return getSchema(corsair, path);
13
+ }
14
+
15
+ // src/core/tools.ts
8
16
  function buildCorsairToolDefs(options) {
9
17
  const {
10
18
  corsair,
@@ -40,7 +48,10 @@ function buildCorsairToolDefs(options) {
40
48
  )
41
49
  },
42
50
  handler: async ({ path }) => {
43
- const result = getSchema(corsair, path);
51
+ const result = formatGetSchemaResponse(
52
+ corsair,
53
+ path
54
+ );
44
55
  return {
45
56
  content: [{ type: "text", text: result }]
46
57
  };
@@ -64,7 +75,12 @@ function buildCorsairToolDefs(options) {
64
75
  corsair
65
76
  );
66
77
  return {
67
- content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
78
+ content: [
79
+ {
80
+ type: "text",
81
+ text: JSON.stringify(result ?? null, null, 2)
82
+ }
83
+ ]
68
84
  };
69
85
  } catch (err) {
70
86
  const message = err instanceof Error ? err.message : String(err);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corsair-dev/mcp",
3
- "version": "0.1.19",
3
+ "version": "0.1.20",
4
4
  "description": "MCP server and SDK adapters for Corsair — list operations, inspect schemas, run API calls",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -21,7 +21,7 @@
21
21
  "express": "^4.21.0",
22
22
  "zod": "^4.1.13",
23
23
  "zod-to-json-schema": "^3.25.0",
24
- "corsair": "0.1.69"
24
+ "corsair": "0.1.70"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "@ai-sdk/mcp": ">=0.0.1",