MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / convertJsonSchemaToParameters

Function convertJsonSchemaToParameters

apps/cli/src/ai/tool-adapter.ts:58–68  ·  view source on GitHub ↗
(schema: ToolDefinition['inputSchema'])

Source from the content-addressed store, hash-verified

56}
57
58function convertJsonSchemaToParameters(schema: ToolDefinition['inputSchema']) {
59 const properties: Record<string, unknown> = {}
60 for (const [key, prop] of Object.entries(schema.properties)) {
61 properties[key] = { ...prop }
62 }
63 return {
64 type: 'object' as const,
65 properties,
66 required: schema.required || [],
67 }
68}
69
70export interface AdaptToolsOptions {
71 maxToolResultTokens?: number

Callers 1

adaptToolsForAgentFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected