@radaros/core 0.1.0 → 0.2.0

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.
@@ -115,15 +115,23 @@ export class ToolExecutor {
115
115
  }> = [];
116
116
 
117
117
  for (const tool of this.tools.values()) {
118
- const jsonSchema = zodToJsonSchema(tool.parameters, {
119
- target: "openApi3",
120
- });
121
-
122
- defs.push({
123
- name: tool.name,
124
- description: tool.description,
125
- parameters: jsonSchema as Record<string, unknown>,
126
- });
118
+ if (tool.rawJsonSchema) {
119
+ defs.push({
120
+ name: tool.name,
121
+ description: tool.description,
122
+ parameters: tool.rawJsonSchema,
123
+ });
124
+ } else {
125
+ const jsonSchema = zodToJsonSchema(tool.parameters, {
126
+ target: "openApi3",
127
+ });
128
+
129
+ defs.push({
130
+ name: tool.name,
131
+ description: tool.description,
132
+ parameters: jsonSchema as Record<string, unknown>,
133
+ });
134
+ }
127
135
  }
128
136
 
129
137
  return defs;
@@ -17,6 +17,8 @@ export interface ToolDef {
17
17
  description: string;
18
18
  parameters: z.ZodObject<any>;
19
19
  execute: (args: Record<string, unknown>, ctx: RunContext) => Promise<string | ToolResult>;
20
+ /** Raw JSON Schema to send to the LLM, bypassing Zod-to-JSON conversion (used by MCP tools). */
21
+ rawJsonSchema?: Record<string, unknown>;
20
22
  }
21
23
 
22
24
  export interface ToolCallResult {