query_company_trademark_list
Retrieve a company's trademarks list, including names, ownership details, and statuses, by entering the full company name. Use this tool to access trademark data for businesses in China.
Instructions
Obtain the list of an company's trademarks, including trademark names, company names, and statuses, by its full name. Please use the fuzzy query tool to obtain the company full name before calling this tool.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entName | Yes | company full name |
Implementation Reference
- src/index.ts:236-250 (handler)The asynchronous handler function that takes the company full name ('entName'), constructs the request data, calls the shared yushantwo helper with product ID 'COM140' to query trademark list via API, and formats the response as text content.async ({entName}) => { const requestData = { entName: entName }; const prodId = "COM140"; const data = await yushantwo(requestData, prodId); return { content: [ { type: "text", text: data, }, ], }; }
- src/index.ts:233-235 (schema)Zod input schema defining a single required string parameter 'entName' for the company full name.{ entName: z.string().describe("company full name"), },
- src/index.ts:230-251 (registration)MCP server tool registration call, specifying the tool name, description, input schema, and inline handler implementation.server.tool( "query_company_trademark_list", "Obtain the list of an company's trademarks, including trademark names, company names, and statuses, by its full name. Please use the fuzzy query tool to obtain the company full name before calling this tool.", { entName: z.string().describe("company full name"), }, async ({entName}) => { const requestData = { entName: entName }; const prodId = "COM140"; const data = await yushantwo(requestData, prodId); return { content: [ { type: "text", text: data, }, ], }; } );
- src/index.ts:49-86 (helper)Shared helper function for making AES-encrypted POST requests to the Yushan API, handling request signing, encryption/decryption, and error handling. Used by multiple tools including this one.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"; } }