debug: add logging for inputSchema structure inspection

This commit is contained in:
Ajax Davis 2025-12-04 09:33:09 +10:00
parent c1e8e55409
commit 956f9fdbae
3 changed files with 12 additions and 2 deletions

View file

@ -1,6 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
import "./.next/types/routes.d.ts";
import "./.next/dev/types/routes.d.ts";
// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

View file

@ -78,6 +78,16 @@ async function loadAndDescribe(req: Request): Promise<Response> {
// Extract tool definition
// AI SDK v6 tools use jsonSchema() which wraps a plain JSON Schema object
// Extract the raw JSON Schema from toolModule.inputSchema.schema
// Debug: Log the inputSchema structure
console.log(`🔍 InputSchema structure for ${cacheKey}:`, {
hasInputSchema: !!toolModule.inputSchema,
inputSchemaType: typeof toolModule.inputSchema,
hasSchema: !!toolModule.inputSchema?.schema,
hasParameters: !!toolModule.inputSchema?.parameters,
keys: toolModule.inputSchema ? Object.keys(toolModule.inputSchema) : [],
});
const rawJsonSchema = toolModule.inputSchema?.schema ?? null;
return Response.json({

View file

@ -1,6 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
import "./.next/types/routes.d.ts";
import "./.next/dev/types/routes.d.ts";
// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.