MCPcopy Index your code
hub / github.com/anomalyco/opencode / toDefinitions

Function toDefinitions

packages/llm/src/tool.ts:221–230  ·  view source on GitHub ↗
(tools: Tools)

Source from the content-addressed store, hash-verified

219 * is reused.
220 */
221export const toDefinitions = (tools: Tools): ReadonlyArray<ToolDefinitionClass> =>
222 Object.entries(tools).map(
223 ([name, item]) =>
224 new ToolDefinition({
225 name,
226 description: item._definition.description,
227 inputSchema: item._definition.inputSchema,
228 outputSchema: item._definition.outputSchema,
229 }),
230 )
231
232const toJsonSchema = (schema: Schema.Top): JsonSchema.JsonSchema => {
233 const document = Schema.toJsonSchemaDocument(schema)

Callers 7

tool.types.tsFile · 0.90
runWeatherToolLoopFunction · 0.90
runToolsFunction · 0.90
llm.tsFile · 0.90
streamFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected