@ductape/mcp 0.1.32 → 0.1.34

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/dist/index.js CHANGED
@@ -533,7 +533,7 @@ ALL params are passed as a JSON array in positional order matching the SDK signa
533
533
  meta.schema_context.database.available_tables — list of all tables that have configured actions
534
534
  meta.schema_warnings — array of warning strings; if it contains "No table schema discovered..." it means no
535
535
  migrations or schema have been synced to the server yet. To fix this, tell the user:
536
- "Run: ductape db schema push --db <database_tag>
536
+ "Run: ductape db schema push --db <database_tag> --env <env_slug>
537
537
  This reads the live table schema from the database and syncs it to the Ductape server,
538
538
  enabling accurate field guidance for AI operations. Once complete, retry your request."
539
539
  databases.count [{ product, env, database, entity, where? }]
@@ -3053,7 +3053,19 @@ async function main() {
3053
3053
  throw new Error('Not authenticated. Set DUCTAPE_PUBLISHABLE_KEY in your MCP server env config, or pass publishable_key on every tool call.');
3054
3054
  }
3055
3055
  const result = await generateExecutablePayload({ ...args, publishable_key: key });
3056
- return { content: [{ type: 'text', text: JSON.stringify(result ?? null, null, 2) }] };
3056
+ let text = JSON.stringify(result ?? null, null, 2);
3057
+ if (args.operation_family === 'database') {
3058
+ const meta = result?.meta ?? {};
3059
+ const fields = meta.schema_context?.database?.fields ?? {};
3060
+ const warnings = Array.isArray(meta.schema_warnings) ? meta.schema_warnings : [];
3061
+ const noSchema = Object.keys(fields).length === 0 || warnings.some((w) => w.includes('No table schema'));
3062
+ if (noSchema) {
3063
+ const dbTag = args.targets?.database_tag ?? '<database_tag>';
3064
+ const envSlug = args.env_slug ?? '<env_slug>';
3065
+ text += `\n\n--- SCHEMA NOT FOUND ---\nNo table schema is available for database "${dbTag}" in environment "${envSlug}".\nTell the user:\n Run: ductape db schema push --db ${dbTag} --env ${envSlug}\n This reads the live schema from the database and syncs it to the Ductape server so the AI can provide accurate field guidance.\n Once complete, retry the operation.\n------------------------`;
3066
+ }
3067
+ }
3068
+ return { content: [{ type: 'text', text }] };
3057
3069
  }
3058
3070
  catch (err) {
3059
3071
  const message = err instanceof Error ? err.message : String(err);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ductape/mcp",
3
- "version": "0.1.32",
3
+ "version": "0.1.34",
4
4
  "description": "MCP server that exposes Ductape SDK operations via the backend proxy",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/src/index.ts CHANGED
@@ -544,7 +544,7 @@ ALL params are passed as a JSON array in positional order matching the SDK signa
544
544
  meta.schema_context.database.available_tables — list of all tables that have configured actions
545
545
  meta.schema_warnings — array of warning strings; if it contains "No table schema discovered..." it means no
546
546
  migrations or schema have been synced to the server yet. To fix this, tell the user:
547
- "Run: ductape db schema push --db <database_tag>
547
+ "Run: ductape db schema push --db <database_tag> --env <env_slug>
548
548
  This reads the live table schema from the database and syncs it to the Ductape server,
549
549
  enabling accurate field guidance for AI operations. Once complete, retry your request."
550
550
  databases.count [{ product, env, database, entity, where? }]
@@ -3153,7 +3153,22 @@ async function main() {
3153
3153
  throw new Error('Not authenticated. Set DUCTAPE_PUBLISHABLE_KEY in your MCP server env config, or pass publishable_key on every tool call.');
3154
3154
  }
3155
3155
  const result = await generateExecutablePayload({ ...args, publishable_key: key });
3156
- return { content: [{ type: 'text', text: JSON.stringify(result ?? null, null, 2) }] };
3156
+
3157
+ let text = JSON.stringify(result ?? null, null, 2);
3158
+
3159
+ if (args.operation_family === 'database') {
3160
+ const meta = (result as any)?.meta ?? {};
3161
+ const fields = meta.schema_context?.database?.fields ?? {};
3162
+ const warnings: string[] = Array.isArray(meta.schema_warnings) ? meta.schema_warnings : [];
3163
+ const noSchema = Object.keys(fields).length === 0 || warnings.some((w: string) => w.includes('No table schema'));
3164
+ if (noSchema) {
3165
+ const dbTag = (args.targets as any)?.database_tag ?? '<database_tag>';
3166
+ const envSlug = (args as any).env_slug ?? '<env_slug>';
3167
+ text += `\n\n--- SCHEMA NOT FOUND ---\nNo table schema is available for database "${dbTag}" in environment "${envSlug}".\nTell the user:\n Run: ductape db schema push --db ${dbTag} --env ${envSlug}\n This reads the live schema from the database and syncs it to the Ductape server so the AI can provide accurate field guidance.\n Once complete, retry the operation.\n------------------------`;
3168
+ }
3169
+ }
3170
+
3171
+ return { content: [{ type: 'text', text }] };
3157
3172
  } catch (err) {
3158
3173
  const message = err instanceof Error ? err.message : String(err);
3159
3174
  return { content: [{ type: 'text', text: `Error: ${message}` }], isError: true };