UNPKG

hana-cli

Version:
28 lines (23 loc) 695 B
export interface ToolDefinition { name: string; description: string; inputSchema: { type: string; properties: Record<string, any>; required?: string[]; }; } export interface ToolResponse { content: Array<{ type: string; text: string }>; isError?: boolean; [key: string]: unknown; } export function textResponse(text: string): ToolResponse { return { content: [{ type: 'text', text }] }; } export function jsonResponse(data: any): ToolResponse { return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] }; } export function errorResponse(message: string): ToolResponse { return { content: [{ type: 'text', text: message }], isError: true }; }