Skip to main content
Glama
linancn

TianGong-LCA-MCP Server

by linancn

Search_Flows_Tool

Search Life Cycle Assessment (LCA) flows data to find environmental impact information for materials and processes.

Instructions

Search LCA flows data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesQueries from user

Implementation Reference

  • Input schema for Search_Flows_Tool defining the required 'query' string parameter using Zod.
    const input_schema = { query: z.string().min(1).describe('Queries from user'), };
  • The handler function (inline in registration) that executes the tool: invokes searchFlows helper with query and bearerKey, formats result as MCP content block.
    server.tool('Search_Flows_Tool', 'Search LCA flows data.', input_schema, async ({ query }) => { const result = await searchFlows( { query, }, bearerKey, ); return { content: [ { type: 'text', text: result, }, ], }; });
  • Core helper implementing the search logic: POSTs query to Supabase edge function /flow_hybrid_search and returns JSON-stringified results.
    async function searchFlows({ query }: { query: string }, bearerKey?: string): Promise<string> { const url = `${supabase_base_url}/functions/v1/flow_hybrid_search`; // console.error('Headers:', headers); 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; } }
  • Registers the tool during MCP server initialization for HTTP transport by calling the regFlowSearchTool function.
    regFlowSearchTool(server, bearerKey);
  • Registers the tool during MCP server initialization by calling the regFlowSearchTool function.
    regFlowSearchTool(server, bearerKey);

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