Skip to main content
Glama
PancrePal-xiaoyibao

Get笔记 MCP Server

knowledge_search

Search your Get笔记 knowledge base using AI-enhanced queries to find processed answers, with support for follow-up questions through conversation history.

Instructions

在Get笔记知识库中进行AI增强搜索,返回经过深度处理的答案。支持对话历史追问。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
questionYes要搜索的问题
topic_idsNo知识库ID列表(当前只支持1个)。如果配置了GET_BIJI_DEFAULT_TOPIC_ID环境变量,可省略此参数
deep_seekYes是否启用深度思考
refsNo是否返回引用来源
historyNo对话历史,用于追问场景

Implementation Reference

  • Core handler function that implements the knowledge_search tool logic: applies rate limiting, handles default topic_ids, makes HTTP POST to '/knowledge/search' API, and processes errors.
    async knowledgeSearch(params: KnowledgeSearchRequest): Promise<any> {
      await this.rateLimiter.waitForSlot();
    
      // 如果没有提供topic_ids且配置了默认topic_id,则使用默认值
      if (!params.topic_ids || params.topic_ids.length === 0) {
        if (this.config.defaultTopicId) {
          params.topic_ids = [this.config.defaultTopicId];
          logger.debug('Using default topic_id', { topic_id: this.config.defaultTopicId });
        } else {
          throw new Error('topic_ids is required or set GET_BIJI_DEFAULT_TOPIC_ID in environment');
        }
      }
    
      try {
        const response = await this.client.post('/knowledge/search', params);
        return response.data;
      } catch (error: any) {
        const errorMsg = error.response?.data?.h?.e || error.message;
        const statusCode = error.response?.status;
        
        logger.error('Knowledge search failed', { 
          error: errorMsg, 
          statusCode,
          params: { ...params, topic_ids: params.topic_ids },
          responseData: error.response?.data 
        });
        
        if (statusCode === 403) {
          throw new Error(`Knowledge search failed: Authentication error (403). Please check your GET_BIJI_API_KEY is valid.`);
        }
        
        throw new Error(`Knowledge search failed: ${errorMsg}`);
      }
    }
  • MCP server tool execution handler for 'knowledge_search': parses arguments, calls client.knowledgeSearch, and returns JSON-formatted result as text content.
    case 'knowledge_search': {
      const { question, topic_ids, deep_seek, refs, history } = args as {
        question: string;
        topic_ids?: string[];
        deep_seek: boolean;
        refs?: boolean;
        history?: ChatMessage[];
      };
    
      const result = await client.knowledgeSearch({
        question,
        topic_ids,
        deep_seek,
        refs,
        history,
      });
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • src/index.ts:38-78 (registration)
    Tool registration in MCP server's tools list: defines name 'knowledge_search', description, and input schema for validation.
    {
      name: 'knowledge_search',
      description: '在Get笔记知识库中进行AI增强搜索,返回经过深度处理的答案。支持对话历史追问。',
      inputSchema: {
        type: 'object',
        properties: {
          question: {
            type: 'string',
            description: '要搜索的问题',
          },
          topic_ids: {
            type: 'array',
            items: { type: 'string' },
            description: '知识库ID列表(当前只支持1个)。如果配置了GET_BIJI_DEFAULT_TOPIC_ID环境变量,可省略此参数',
          },
          deep_seek: {
            type: 'boolean',
            description: '是否启用深度思考',
            default: true,
          },
          refs: {
            type: 'boolean',
            description: '是否返回引用来源',
            default: false,
          },
          history: {
            type: 'array',
            items: {
              type: 'object',
              properties: {
                content: { type: 'string' },
                role: { type: 'string', enum: ['user', 'assistant'] },
              },
              required: ['content', 'role'],
            },
            description: '对话历史,用于追问场景',
          },
        },
        required: ['question', 'deep_seek'],
      },
    },
  • TypeScript type definition for KnowledgeSearchRequest interface, matching the tool's input schema, used in client code.
    export interface KnowledgeSearchRequest {
      question: string;
      topic_ids?: string[];  // 可选,如果配置了defaultTopicId
      deep_seek: boolean;
      refs?: boolean;
      history?: ChatMessage[];
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions 'AI-enhanced search' and 'deeply processed answers', but doesn't clarify what 'deep processing' entails, whether there are rate limits, authentication requirements, or what happens when multiple topic_ids are provided despite the note about current single support. The description adds some context but leaves significant behavioral aspects unspecified.

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 brief (two short sentences) and front-loaded with the core functionality. Every sentence contributes value, though it could be slightly more structured. There's no wasted verbiage or redundancy.

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?

For a 5-parameter search tool with no annotations and no output schema, the description is moderately complete. It covers the core purpose and mentions conversation history support, but doesn't explain the nature of 'AI enhancement', what 'deep processing' means, or what the output format looks like. Given the complexity and lack of structured metadata, more behavioral context would be helpful.

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 all parameters thoroughly. The description doesn't add any meaningful parameter semantics beyond what's in the schema - it doesn't explain how parameters interact or provide usage examples. Baseline 3 is appropriate when schema does the heavy lifting.

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 performs 'AI-enhanced search' in the 'Get笔记知识库' and returns 'deeply processed answers'. It specifies the resource (knowledge base) and action (search with AI enhancement). However, it doesn't explicitly differentiate from sibling tools like 'knowledge_recall', 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 Guidelines3/5

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

The description mentions 'support for conversation history follow-up questions', which implies usage in conversational contexts. However, it doesn't provide explicit guidance on when to use this tool versus alternatives like 'knowledge_recall', nor does it mention any prerequisites or exclusions for usage.

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/PancrePal-xiaoyibao/get_biji_mcp'

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