Skip to main content
Glama
zhenzp

Fund MCP Server

by zhenzp

fund.knoewledge

Search and retrieve financial fund information from a knowledge base using keywords, enabling users to query fund data through natural language.

Instructions

获取的知识库列表信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kwNo关键词,支持模糊查询
pageSizeNo每页数量,默认10
pageNumNo页码,默认1

Implementation Reference

  • The core handler function for the 'fund.knoewledge' tool. Parses input args, constructs API URL with query params, fetches from KB_API_URL, and returns the JSON response as standardized content.
    async function handleKnowledge(args: unknown) {
      const { kw = "", pageSize = 10, pageNum = 1 } = knowledgeSchema.parse(args);
    
      const url = new URL(KB_API_URL);
      url.searchParams.set("kw", kw);
      url.searchParams.set("pageSize", String(pageSize));
      url.searchParams.set("pageNum", String(pageNum));
    
      const response = await fetch(url.toString(), {
        method: "GET",
        headers: {
          Accept: "application/json",
        },
      });
    
      if (!response.ok) {
        throw new Error(
          `Knowledge API request failed: ${response.status} ${response.statusText}`
        );
      }
    
      let data: any;
      try {
        data = await response.json();
      } catch (e) {
        throw new Error("Knowledge API returned invalid JSON");
      }
    
      // Normalize basic shape: { code, msg, result }
      console.log('handleKnowledge', data)
      return {
        content: [{ type: "text", text: JSON.stringify(data) }],
      };
    }
  • Zod schema used in the handler to validate and parse input parameters for the knowledge query (kw, pageSize, pageNum).
    const knowledgeSchema = z.object({
      kw: z.string().optional().default(""),
      pageSize: z.number().int().positive().optional(),
      pageNum: z.number().int().positive().optional(),
    });
  • Tool registration entry in getAllTools() array, defining name, description, and input schema for MCP tool discovery.
    {
      name: 'fund.knoewledge',
      description: '获取的知识库列表信息',
      inputSchema: {
        type: 'object',
        properties: {
          kw: { type: 'string', description: '关键词,支持模糊查询' },
          pageSize: { type: 'number', description: '每页数量,默认10' },
          pageNum: { type: 'number', description: '页码,默认1' }
        },
      }
    },
  • Dispatch logic in handleToolRequest that routes 'fund.knoewledge' calls to the handleKnowledge function.
    if (name === "fund.knoewledge") {
      return await handleKnowledge(args);
    }
  • API endpoint URL configuration for the knowledge base query, with env var fallback.
    const KB_API_URL =
      process.env.FUND_KB_API_URL ||
      "https://reportdev.haiyu.datavita.com.cn/api/admin/knowledge/query"
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states the action ('get knowledge base list information') without mentioning any behavioral traits such as whether it's read-only, requires authentication, has rate limits, or what the return format looks like. This leaves significant gaps for a tool with parameters and no output schema.

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

Conciseness4/5

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

The description is a single phrase '获取的知识库列表信息', which is concise and front-loaded with the core action. However, it's overly brief and under-specified for a tool with parameters and no output schema, slightly reducing its effectiveness despite the efficient structure.

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

Completeness2/5

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

Given the tool has 3 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain the return values, behavioral context, or usage scenarios, leaving the agent with insufficient information to fully understand how to invoke and interpret results from this tool.

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?

The input schema has 100% description coverage, with clear documentation for 'kw' (keyword for fuzzy search), 'pageSize' (items per page, default 10), and 'pageNum' (page number, default 1). The description adds no additional meaning beyond what the schema provides, so it meets the baseline of 3 where the schema does the heavy lifting.

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

Purpose3/5

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

The description '获取的知识库列表信息' translates to 'Get knowledge base list information', which states the purpose (retrieving a list) but is vague about what 'knowledge base' refers to and doesn't distinguish from siblings like 'fund.echo' or 'fund.stock_search'. It provides a basic verb+resource but lacks specificity and sibling differentiation.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives like 'fund.stock_search'. The description implies it's for listing knowledge bases, but there's no explicit context, exclusions, or prerequisites mentioned, leaving the agent with no usage direction beyond the basic purpose.

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/zhenzp/fund-mcp-server'

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