Search_processes_Tool
Find and retrieve Life Cycle Assessment (LCA) process data using the TianGong-LCA-MCP Server by entering specific queries for accurate results.
Instructions
Search LCA processes data.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Queries from user |
Implementation Reference
- src/tools/process_hybrid_search.ts:38-60 (registration)Registers the 'Search_Processes_Tool' with the MCP server by calling server.tool() with schema and handler.export function regProcessSearchTool(server: McpServer, bearerKey?: string): void { server.tool( 'Search_Processes_Tool', 'Search LCA processes data.', input_schema, async ({ query }) => { const result = await searchProcesses( { query, }, bearerKey, ); return { content: [ { type: 'text', text: result, }, ], }; }, ); }
- src/tools/process_hybrid_search.ts:10-36 (handler)Main handler logic: sends POST request to Supabase edge function for hybrid search on processes data.async function searchProcesses({ query }: { query: string }, bearerKey?: string): Promise<string> { const url = `${supabase_base_url}/functions/v1/process_hybrid_search`; // console.error('URL:', url); try { const response = await fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${bearerKey}`, 'x-region': x_region, }, body: JSON.stringify( cleanObject({ query, }), ), }); if (!response.ok) { throw new Error(`HTTP error: ${response.status} ${response.statusText}`); } const data = await response.json(); return JSON.stringify(data); } catch (error) { console.error('Error making the request:', error); throw error; } }
- Zod schema defining the input: query string.const input_schema = { query: z.string().min(1).describe('Queries from user'), };