20 lines
502 B
TypeScript
20 lines
502 B
TypeScript
import type { ToolRegistry } from '../tools/classes.toolregistry.js';
|
|
|
|
export interface IMcpToolDescriptor {
|
|
name: string;
|
|
description: string;
|
|
inputSchema: Record<string, unknown>;
|
|
}
|
|
|
|
export class McpDescriptor {
|
|
constructor(private toolRegistry: ToolRegistry) {}
|
|
|
|
public listMcpTools(): IMcpToolDescriptor[] {
|
|
return this.toolRegistry.listTools().map((toolArg) => ({
|
|
name: toolArg.id,
|
|
description: toolArg.description,
|
|
inputSchema: toolArg.inputSchema,
|
|
}));
|
|
}
|
|
}
|