json-object-editor 0.10.638 → 0.10.639
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/package.json +1 -1
- package/server/modules/MCP.js +4 -0
package/package.json
CHANGED
package/server/modules/MCP.js
CHANGED
|
@@ -158,6 +158,8 @@ MCP.tools = {
|
|
|
158
158
|
// Get schema definition; summaryOnly to return normalized summary instead of full schema
|
|
159
159
|
getSchema: async ({ name, summaryOnly }, _ctx) => {
|
|
160
160
|
if (!name) throw new Error("Missing required param 'name'");
|
|
161
|
+
const Schemas = getSchemas();
|
|
162
|
+
if (!Schemas) throw new Error('Schemas module not initialized');
|
|
161
163
|
if (summaryOnly) {
|
|
162
164
|
const sum = Schemas && Schemas.summary && Schemas.summary[name];
|
|
163
165
|
if (!sum) throw new Error(`Schema summary for "${name}" not found`);
|
|
@@ -170,6 +172,8 @@ MCP.tools = {
|
|
|
170
172
|
|
|
171
173
|
// Get multiple schemas. With summaryOnly, return summaries; without names, returns all.
|
|
172
174
|
getSchemas: async ({ names, summaryOnly } = {}, _ctx) => {
|
|
175
|
+
const Schemas = getSchemas();
|
|
176
|
+
if (!Schemas) throw new Error('Schemas module not initialized');
|
|
173
177
|
const all = (Schemas && Schemas.schema) || {};
|
|
174
178
|
if (summaryOnly) {
|
|
175
179
|
const allS = (Schemas && Schemas.summary) || {};
|