Skip to main content
Glama
usensedata

usensedata-mcp-server-query-china-company

Official
by usensedata

query_company_court_litigation_related_info

Retrieve court litigation details of a Chinese company by its full name using fuzzy query. Access comprehensive legal records for accurate insights.

Instructions

Obtain the litigation - related information of a target company in court by its full name. Please use the fuzzy query tool to obtain the company full name before calling this tool.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYescompany full name

Implementation Reference

  • The handler function that takes the company full name, constructs a requestData object including a comprehensive dataType string for various litigation-related categories, calls the shared yushantwo API helper with product ID 'PBB183', and formats the response as MCP tool content.
    async ({name}) => { const requestData = { name: name, dataType: "satparty,fdaparty,epbparty,qtsparty,xzhmd,pbcparty,news,cpws,ktgg,zxgg,shixin,fygg,ajlc,bgt,zcdj,zccf,jyyc,job" }; const prodId = "PBB183"; const data = await yushantwo(requestData, prodId); return { content: [ { type: "text", text: data, }, ], }; }
  • Input schema for the tool, defining a single string parameter 'name' for the company full name with Zod validation and description.
    { name: z.string().describe("company full name"), },
  • src/index.ts:253-275 (registration)
    Registration of the 'query_company_court_litigation_related_info' tool using server.tool(), including name, description, input schema, and inline handler.
    server.tool( "query_company_court_litigation_related_info", "Obtain the litigation - related information of a target company in court by its full name. Please use the fuzzy query tool to obtain the company full name before calling this tool.", { name: z.string().describe("company full name"), }, async ({name}) => { const requestData = { name: name, dataType: "satparty,fdaparty,epbparty,qtsparty,xzhmd,pbcparty,news,cpws,ktgg,zxgg,shixin,fygg,ajlc,bgt,zcdj,zccf,jyyc,job" }; const prodId = "PBB183"; const data = await yushantwo(requestData, prodId); return { content: [ { type: "text", text: data, }, ], }; } );
  • Shared helper function yushantwo used by all tools, including this one, to make encrypted POST requests to the Yushan API (URL redacted), generate request SN, encrypt body with AES, send with auth headers, decrypt response, and return the data. Called with specific prodId 'PBB183' for litigation info.
    async function yushantwo(requestData: RequestData, prodId: string): Promise<string> { const url = "***"; const reqTime = Date.now(); const requestSN = Array.from({ length: 32 }, () => "ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678"[Math.floor(Math.random() * 58)]).join(""); const requestBody = JSON.stringify({ prod_id: prodId, req_data: requestData, req_time: reqTime, request_sn: requestSN, }); // 加密请求数据 const encryptedRequest = encrypt(requestBody, apiKey); const headers = { AES_KEY: apiKey, ACCT_ID: apiUserId, ENCODE: "AES256", }; try { const response = await fetch(url, { method: "POST", headers: headers, body: encryptedRequest, }); const responseText = await response.text(); // 解密返回数据 const decryptedString = decrypt(responseText, apiKey); return decryptedString; } catch (e) { console.error("Error:", e); return "error"; } }

Other Tools

Related Tools

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/usensedata/usensedata-mcp-server-query-china-company'

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