Skip to main content
Glama
linancn

TianGong-LCA-MCP Server

by linancn

OpenLCA_List_System_Processes_Tool

Lists all system processes in OpenLCA for inventory analysis and modeling workflows. Connect to an OpenLCA IPC server to retrieve process data.

Instructions

List all system processes using OpenLCA.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serverUrlNoOpenLCA IPC server URLhttp://localhost:8080

Implementation Reference

  • Core function that executes the tool logic: connects to OpenLCA IPC server, retrieves process descriptors, filters for system processes (LCI_RESULT type), formats the data by removing undefined fields, and returns JSON string.
    async function listSystemProcesses({ serverUrl = 'http://localhost:8080', }: { serverUrl?: string; }): Promise<string> { const client = o.IpcClient.on(serverUrl); const processes = await client.getDescriptors(o.RefType.Process); const systemProcesses = processes.filter((proc) => proc.processType === o.ProcessType.LCI_RESULT); if (systemProcesses.length === 0) { throw new Error('No system processes found'); } const resultsObj = systemProcesses.map((sys) => { // Create full object const result: Record<string, any> = { id: sys.id, category: sys.category, description: sys.description, flowType: sys.flowType, location: sys.location, name: sys.name, processType: sys.processType, refUnit: sys.refUnit, refType: sys.refType, }; // Remove undefined properties Object.keys(result).forEach((key) => { if (result[key] === undefined) { delete result[key]; } }); return result; }); return JSON.stringify(resultsObj); }
  • Zod schema defining the tool's input parameters, specifically the optional OpenLCA server URL.
    const input_schema = { serverUrl: z.string().default('http://localhost:8080').describe('OpenLCA IPC server URL'), };
  • Registration function that adds the tool to the MCP server using server.tool(), including name, description, input schema, and handler function.
    export function regOpenLcaListSystemProcessesTool(server: McpServer) { server.tool( 'OpenLCA_List_System_Processes_Tool', 'List all system processes using OpenLCA.', input_schema, async ({ serverUrl }) => { const result = await listSystemProcesses({ serverUrl: serverUrl, }); return { content: [ { type: 'text', text: result, }, ], }; }, ); }
  • Invokes the tool registration during MCP server initialization.
    regOpenLcaListSystemProcessesTool(server);

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