Skip to main content
Glama

ask_repo_ai

Query a specialized AI assistant to analyze repository code, structure, and documentation, returning answers with file and doc links.

Instructions

向仓库 AI 助手提问(AI 调用 AI)。

此工具让当前的 AI 通过 MCP 协议调用另一个专门的仓库 AI 助手来回答问题。 被调用的 AI 助手基于仓库文档内容进行分析,并回答你的问题。

被调用的 AI 助手拥有的工具:

  • get_repo_structure: 分析并展示代码仓库的目录结构

  • view_file_schema: 查看文件大纲,使用 AST 解析提取文件结构

  • view_file_in_detail: 读取并显示文件的具体内容

  • web_search: 网络搜索,使用简洁的关键词检索相关信息

  • doc_search: 文档搜索,查找指南教程文档中的相关页面

如果需要分析特定文件或目录结构,可以在问题中显式要求 AI 使用上述工具进行回复。

对于仓库代码的复杂需求,应该优先使用此工具,如果有多个问题可并行调用。 适用于理解项目架构、使用方法、代码示例等复杂问题。 支持的 AI 模型: glm-4.7 (默认), claude-sonnet-4.5

返回的 Markdown 回答内容中可能包含两种链接格式:

  1. 仓库文件链接 - 格式: [文件名](文件路径#L开始行号-L结束行号) 例如: [index.ts](index.ts#L1-L28) [package.json](package.json#L1-L77) 这类链接指向仓库内的源代码文件,可提取文件路径和行号范围, 使用 fetch_repository_file(repo_path, file_path, start_line, end_line) 获取具体内容。

  2. 文档导航链接 - 格式: [标题](页面slug) 例如: [概述](1-overview) [快速开始](2-quick-start) 这类链接指向文档的其他页面,使用 fetch_documentation_page(repo_path, 页面slug) 获取该页文档内容。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_pathYes仓库路径,格式: owner/repo 或完整 URL
questionYes要向 AI 提问的问题,如 "这个项目是做什么的?"
ai_modelNoAI 模型选择,默认 "glm-4.7",可选 "claude-sonnet-4.5"glm-4.7
languageNo对话语言,可选 "zh" 或 "en"zh
Behavior5/5

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

With no annotations, the description fully discloses that it delegates to another AI, lists the tools that AI uses, explains the response format with link syntax, and mentions supported models. No contradictions.

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?

Well-structured with sections for purpose, tools, usage tips, models, and output format. Every sentence adds value; no redundancy despite the length.

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

Completeness5/5

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

No output schema, but description fully explains the Markdown response with two link types and how to use sibling tools to fetch linked content. Also covers model options and usage patterns, making it self-contained.

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 coverage is 100% with clear descriptions for all 4 parameters. The description adds no new parameter-specific meaning beyond the schema; the extensive context is about tool behavior and output handling.

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 that the tool asks a specialized repository AI assistant questions via MCP protocol, distinguishing it from sibling tools that perform direct repository actions like fetching files or checking status.

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?

Provides explicit guidance: use for complex code understanding, ask for specific file analysis within the question, and parallelize multiple questions. Implicitly contrasts with simpler sibling tools for direct file access.

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/ejfkdev/zread-mcp'

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