Skip to main content
Glama
PancrePal-xiaoyibao

Get笔记 MCP Server

knowledge_recall

Search and retrieve raw content from Get笔记 knowledge bases to quickly find and preview relevant information without AI processing.

Instructions

在Get笔记知识库中召回相关内容,返回未经AI处理的原始结果。可用于快速查找和预览。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
questionYes要搜索的问题
topic_idNo知识库ID(单个)
topic_idsNo知识库ID列表(当前只支持1个)。注意:topic_id和topic_ids可都不提供,如果配置了GET_BIJI_DEFAULT_TOPIC_ID环境变量。优先使用topic_id
top_kNo返回相似度最高的N个结果
intent_rewriteNo是否进行问题意图重写
select_matrixNo是否对结果进行重选
historyNo对话历史,用于追问场景

Implementation Reference

  • Main handler for the knowledge_recall MCP tool: extracts parameters from request, invokes client.knowledgeRecall, formats results for readability (truncates content, adds index/score), and returns formatted JSON as tool response content.
    case 'knowledge_recall': {
      const { question, topic_id, topic_ids, top_k, intent_rewrite, select_matrix, history } = args as {
        question: string;
        topic_id?: string;
        topic_ids?: string[];
        top_k?: number;
        intent_rewrite?: boolean;
        select_matrix?: boolean;
        history?: ChatMessage[];
      };
    
      const result = await client.knowledgeRecall({
        question,
        topic_id,
        topic_ids,
        top_k,
        intent_rewrite,
        select_matrix,
        history,
      });
    
      // 格式化输出
      const formattedResults = result.c.data.map((item, index) => ({
        index: index + 1,
        title: item.title || '无标题',
        content: item.content.substring(0, 500) + (item.content.length > 500 ? '...' : ''),
        score: item.score.toFixed(4),
        type: item.type,
        source: item.recall_source,
      }));
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              total: result.c.data.length,
              results: formattedResults,
            }, null, 2),
          },
        ],
      };
    }
  • src/index.ts:79-128 (registration)
    Tool registration in the tools array: defines name 'knowledge_recall', description, and detailed inputSchema for MCP listTools response.
    {
      name: 'knowledge_recall',
      description: '在Get笔记知识库中召回相关内容,返回未经AI处理的原始结果。可用于快速查找和预览。',
      inputSchema: {
        type: 'object',
        properties: {
          question: {
            type: 'string',
            description: '要搜索的问题',
          },
          topic_id: {
            type: 'string',
            description: '知识库ID(单个)',
          },
          topic_ids: {
            type: 'array',
            items: { type: 'string' },
            description: '知识库ID列表(当前只支持1个)。注意:topic_id和topic_ids可都不提供,如果配置了GET_BIJI_DEFAULT_TOPIC_ID环境变量。优先使用topic_id',
          },
          top_k: {
            type: 'number',
            description: '返回相似度最高的N个结果',
            default: 10,
          },
          intent_rewrite: {
            type: 'boolean',
            description: '是否进行问题意图重写',
            default: false,
          },
          select_matrix: {
            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'],
      },
    },
  • TypeScript interface defining the input parameters for knowledge_recall (KnowledgeRecallRequest), used by the client.
    export interface KnowledgeRecallRequest {
      question: string;
      topic_id?: string;        // 单个知识库ID,优先使用
      topic_ids?: string[];     // 知识库ID列表(当前只支持1个)
      top_k?: number;
      intent_rewrite?: boolean;
      select_matrix?: boolean;
      history?: ChatMessage[];
    }
  • Core helper function in GetBijiClient: handles HTTP POST to API endpoint '/knowledge/search/recall', manages default topic_id, rate limiting, error handling, and validation.
    async knowledgeRecall(params: KnowledgeRecallRequest): Promise<KnowledgeRecallResponse> {
      await this.rateLimiter.waitForSlot();
    
      // 如果没有提供topic_id和topic_ids,但配置了默认topic_id,则使用默认值
      if (!params.topic_id && (!params.topic_ids || params.topic_ids.length === 0)) {
        if (this.config.defaultTopicId) {
          params.topic_id = this.config.defaultTopicId;
        } else {
          throw new Error('topic_id or topic_ids is required, or set GET_BIJI_DEFAULT_TOPIC_ID in environment');
        }
      }
    
      try {
        const response = await this.client.post<KnowledgeRecallResponse>(
          '/knowledge/search/recall',
          params
        );
        
        if (response.data.h.c !== 0) {
          throw new Error(response.data.h.e || 'Unknown error');
        }
    
        return response.data;
      } catch (error: any) {
        const errorMsg = error.response?.data?.h?.e || error.message;
        logger.error('Knowledge recall failed', { error: errorMsg, params });
        throw new Error(`Knowledge recall failed: ${errorMsg}`);
      }
    }
  • TypeScript interface defining the response structure from the knowledge_recall API call (KnowledgeRecallResponse).
    export interface KnowledgeRecallResponse {
      h: {
        c: number;
        e: string;
        s: number;
        t: number;
        apm: string;
      };
      c: {
        data: RecallItem[];
      };
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions that results are '未经AI处理的原始结果' (raw results without AI processing), which is valuable behavioral context. However, it doesn't disclose other important traits: whether this is a read-only operation, what permissions are needed, rate limits, error conditions, or what the return format looks like (especially problematic since there's no output schema). For a 7-parameter tool with no annotation coverage, this is insufficient.

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 appropriately concise with two sentences. The first sentence states the core purpose and key behavioral trait (raw results). The second sentence provides usage context. There's no wasted text, and the information is front-loaded. It could potentially be more structured with explicit sections, but it's efficient for its length.

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 complexity (7 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain what the tool returns (critical without output schema), doesn't mention error handling, and provides minimal behavioral context. While it covers the basic purpose and one key trait (raw results), it leaves too many gaps for a tool of this complexity with no structured support from annotations or output schema.

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 schema description coverage is 100%, so the schema already documents all 7 parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema. According to the scoring rules, when schema_description_coverage is high (>80%), the baseline is 3 even with no parameter information in the description. The description doesn't compensate or add value here.

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: '在Get笔记知识库中召回相关内容' (recall related content in Get笔记 knowledge base) with the specific verb '召回' (recall/retrieve) and resource '相关内容' (related content). It distinguishes from sibling 'knowledge_search' by specifying '返回未经AI处理的原始结果' (returns raw results without AI processing). However, it doesn't explicitly contrast with 'get_rate_limit_stats' which serves a completely different purpose.

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 provides some usage context: '可用于快速查找和预览' (can be used for quick lookup and preview), which implies this is for retrieval rather than analysis or processing. However, it doesn't explicitly state when to use this tool versus 'knowledge_search' (the sibling tool), nor does it mention any prerequisites or exclusions. The guidance is implied rather than explicit.

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