verify_company_name_and_president
Verify Chinese company registration by checking if the legal representative's name matches the official company name. Returns 0 for consistency or 1 for inconsistency.
Instructions
Verification of the two elements of the legal representative's name and company full name. Return 0 to indicate consistency, and return 1 to indicate inconsistency. Please use the fuzzy query tool to obtain the company full name before calling this tool.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| operName | Yes | representative's name | |
| entName | Yes | company full name |
Implementation Reference
- src/index.ts:95-110 (handler)Handler function that prepares request data with operName and entName, calls yushantwo API with product ID 'COM030', and returns the response as text content.async ({ operName, entName }) => { const requestData = { operName: operName, entName: entName, }; const prodId = "COM030"; const data = await yushantwo(requestData, prodId); return { content: [ { type: "text", text: data, }, ], }; }
- src/index.ts:91-94 (schema)Input schema defining parameters operName (representative's name) and entName (company full name) using Zod validation.{ operName: z.string().describe("representative's name"), entName: z.string().describe("company full name"), },
- src/index.ts:88-111 (registration)Registration of the 'verify_company_name_and_president' tool with MCP server, including name, description, input schema, and handler function.server.tool( "verify_company_name_and_president", "Verification of the two elements of the legal representative's name and company full name. Return 0 to indicate consistency, and return 1 to indicate inconsistency. Please use the fuzzy query tool to obtain the company full name before calling this tool.", { operName: z.string().describe("representative's name"), entName: z.string().describe("company full name"), }, async ({ operName, entName }) => { const requestData = { operName: operName, entName: entName, }; const prodId = "COM030"; const data = await yushantwo(requestData, prodId); return { content: [ { type: "text", text: data, }, ], }; } );
- src/index.ts:49-86 (helper)Helper function yushantwo that handles API calls to Yushan service: encrypts request body with AES, sends POST request, decrypts and returns response. Used by the tool handler.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"; } }