Skip to main content
Glama
usensedata

usensedata-mcp-server-query-china-company

Official
by usensedata

fuzzy_query_company

Search Chinese companies using partial or approximate name keywords to retrieve full enterprise information for further data queries.

Instructions

Fuzzy search through company name keywords to return a list of enterprise information. Use this tool to retrieve the company's full name before calling other tools that require it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyWordYescompany name keywords

Implementation Reference

  • The asynchronous handler function implementing the core logic of the 'fuzzy_query_company' tool. It takes a keyword, prepares request data with skip='20', calls the yushantwo API helper with prodId='PBB020', and returns the result formatted as MCP content.
    async ({ keyWord }) => {
      const requestData = {
        keyWord: keyWord,
        skip: "20",
      };
      const prodId = "PBB020";
      const data = await yushantwo(requestData, prodId);
      return {
        content: [
          {
            type: "text",
            text: data,
          },
        ],
      };
    }
  • Zod schema defining the input parameter 'keyWord' as a required string for company name keywords.
    {
      keyWord: z.string().describe("company name keywords"),
    },
  • src/index.ts:113-135 (registration)
    The server.tool registration call that defines and registers the 'fuzzy_query_company' tool with its name, description, input schema, and inline handler function.
    server.tool(
      "fuzzy_query_company",
      "Fuzzy search through company name keywords to return a list of enterprise information. Use this tool to retrieve the company's full name before calling other tools that require it.",
      {
        keyWord: z.string().describe("company name keywords"),
      },
      async ({ keyWord }) => {
        const requestData = {
          keyWord: keyWord,
          skip: "20",
        };
        const prodId = "PBB020";
        const data = await yushantwo(requestData, prodId);
        return {
          content: [
            {
              type: "text",
              text: data,
            },
          ],
        };
      }
    );
  • Shared utility function 'yushantwo' that performs encrypted HTTP POST requests to the Yushan API using fetch, handles encryption/decryption with AES256, and is called by the tool handler to execute the actual query.
    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?

With no annotations provided, the description carries the full burden. It discloses the fuzzy search behavior and that it returns a list, but lacks details on pagination, result limits, error conditions, or authentication requirements. It adds some context but is incomplete for behavioral transparency.

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 front-loaded with the core purpose and includes a clear usage guideline in two concise sentences, with no wasted words or redundant information.

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

Completeness4/5

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

Given the simple single-parameter input, no output schema, and no annotations, the description adequately covers purpose and usage. However, it could improve by hinting at the output structure or error handling, though the low complexity makes this less critical.

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%, so the schema already documents the single parameter. The description adds minimal value by mentioning 'company name keywords' but doesn't provide additional syntax, format, or examples beyond what the schema states.

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

Purpose5/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 with specific verbs ('fuzzy search', 'return a list') and resources ('company name keywords', 'enterprise information'), and it distinguishes from siblings by focusing on name-based search rather than specific data categories like litigation or trademarks.

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?

It explicitly states when to use this tool ('to retrieve the company's full name before calling other tools that require it'), providing clear guidance on its role as a preparatory step for sibling tools that need exact company names.

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