Skip to main content
Glama
linancn

TianGong-LCA-MCP Server

by linancn

Search_Processes_Tool

Search Life Cycle Assessment (LCA) processes data to find relevant environmental impact information for sustainability analysis.

Instructions

Search LCA processes data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesQueries from user

Implementation Reference

  • Core handler function that executes the hybrid search by calling a Supabase edge function with the query.
    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; } }
  • Input schema using Zod for validating the tool's 'query' parameter.
    const input_schema = { query: z.string().min(1).describe('Queries from user'), };
  • Registers the 'Search_Processes_Tool' with the MCP server, linking 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, }, ], }; }, ); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/linancn/tiangong-lca-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server