Skip to main content
Glama
usensedata

usensedata-mcp-server-query-china-company

Official
by usensedata

query_company_basic_info

Retrieve essential company details like name, legal representative, and registered capital for Chinese businesses to assess their basic profile and structure.

Instructions

Query and return basic information such as company name, legal representative, and registered capital by company full name to understand the company overview. Please use the fuzzy query tool to obtain the company full name before calling this tool.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entnameYescompany full name

Implementation Reference

  • The handler function for the 'query_company_basic_info' tool. It takes the company full name ('entname'), constructs a request data object, calls the shared 'yushantwo' helper with product ID 'PBB021' to query the API, and returns the response as structured text content.
    async ({entname}) => {
      const requestData = {
        entname: entname
      };
      const prodId = "PBB021";
      const data = await yushantwo(requestData, prodId);
      return {
        content: [
          {
            type: "text",
            text: data,
          },
        ],
      };
    }
  • The input schema for the tool, defining a single required string parameter 'entname' which is the company full name.
    {
      entname: z.string().describe("company full name"),
    },
  • src/index.ts:137-158 (registration)
    The registration of the 'query_company_basic_info' tool using McpServer.tool(), including the tool name, description, input schema, and inline handler function.
    server.tool(
      "query_company_basic_info",
      "Query and return basic information such as company name, legal representative, and registered capital by company full name to understand the company overview. 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 = "PBB021";
        const data = await yushantwo(requestData, prodId);
        return {
          content: [
            {
              type: "text",
              text: data,
            },
          ],
        };
      }
    );
  • Shared helper function 'yushantwo' used by the tool (and others) to make encrypted API requests to the Yushan service and decrypt responses. This is the core logic for interacting with the external API.
    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";
      }
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It describes the query/return behavior and mentions the need for a company full name obtained via another tool. However, it doesn't disclose important behavioral traits like whether this is a read-only operation, potential rate limits, authentication requirements, error conditions, or what happens with invalid inputs. The description adds some context but leaves significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is perfectly concise with two sentences that each earn their place. The first sentence states the purpose and scope, while the second provides crucial usage guidance. There's zero wasted text, and the most important information (what it does and when to use it) is front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 1 parameter with 100% schema coverage but no annotations and no output schema, the description is moderately complete. It covers purpose and usage guidelines well, but lacks behavioral transparency details that would be important for a query tool (like response format, error handling, or limitations). The absence of output schema means the description should ideally describe return values, which it doesn't.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% (the single parameter 'entname' has description 'company full name'), so the baseline is 3. The description adds marginal value by reinforcing that the parameter should be a 'company full name' and suggesting it should come from the fuzzy query tool, but doesn't provide additional semantic context beyond what the schema already documents.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Query and return basic information such as company name, legal representative, and registered capital by company full name to understand the company overview.' This specifies the verb (query/return), resource (company basic info), and scope (overview). However, it doesn't explicitly differentiate from siblings like 'verify_company_name_and_president' which might have overlapping functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit usage guidance: 'Please use the fuzzy query tool to obtain the company full name before calling this tool.' This clearly states a prerequisite and references the sibling tool 'fuzzy_query_company' as an alternative for obtaining the required parameter. It effectively tells when to use this tool (after obtaining full name via fuzzy query).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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