Tools Reference
CodeWiki MCP provides 5 tools for querying open-source repository documentation.
Tools Architecture
Keyword Resolution v1.2.0+
All tools accept bare keywords (e.g. "vue", "react") in the repo_url parameter, in addition to full URLs and owner/repo shorthand. The resolution pipeline:
- CodeWiki search scraping — searches
codewiki.googlefor matching repos. - GitHub API fallback v1.3.0 — if CodeWiki returns zero results, queries
api.github.com/search/repositoriesto catch typos (e.g. "fecbook/react" → "facebook/react"). - MCP Elicitation — when multiple repos match, interactively asks the user to pick via the MCP Elicitation protocol (requires a supporting client).
- Heuristic top-pick — if elicitation is unavailable, selects the top result by star count.
When a keyword is resolved, responses are prefixed with a resolution note:
> **Resolved:** keyword "vue" → **vuejs/vue** (209.9k★)
codewiki_list_topics
Retrieve section titles and short content previews for a repository. Returns a lightweight topic listing — not the full page content. Use this for quick discovery before drilling into specific sections.
| Parameter | Type | Required | Description |
|---|---|---|---|
repo_url | string | Yes | Full URL, owner/repo shorthand, or bare keyword (e.g. "react") |
Returns titles + 200-char previews per section. Renders via Playwright, caches result for 5 minutes.
codewiki_read_structure
Get a JSON list of documentation sections/topics. Recommended first step — the most token-efficient tool. Returns only titles and heading levels as structured data.
| Parameter | Type | Required | Description |
|---|---|---|---|
repo_url | string | Yes | Full URL, owner/repo shorthand, or bare keyword |
Renders the page via Playwright, caches result for 5 minutes.
codewiki_read_contents
View full or section-specific documentation. Without section_title, returns paginated sections. With section_title, returns just that section.
| Parameter | Type | Required | Description |
|---|---|---|---|
repo_url | string | Yes | Full URL, owner/repo shorthand, or bare keyword |
section_title | string | No | Title (or partial) of a section to retrieve |
offset | int | No | Section index to start from (default 0) |
limit | int | No | Max sections per response (default 5, max 50) |
Supports pagination — the response includes has_more and next_offset hints when more sections are available.
codewiki_search_wiki
Ask Google CodeWiki a question about an open-source repository. Uses the interactive Gemini-powered chat. Results are cached for 2 minutes.
| Parameter | Type | Required | Description |
|---|---|---|---|
repo_url | string | Yes | Full URL, owner/repo shorthand, or bare keyword |
query | string | Yes | The question to ask |
Opens a new browser context, interacts with the chat panel, waits for the streamed Gemini response. Repeated identical queries are served from cache instantly.
Examples
repo_url: https://github.com/microsoft/vscode-copilot-chat
query: Where are the Allow/Skip buttons implemented?
repo_url: microsoft/vscode
query: How does the extension activation work?
# Bare keyword — resolves automatically
repo_url: react
query: How does the reconciler work?
codewiki_request_indexing
Submit a repository to Google CodeWiki for indexing. Use this when other tools return a NOT_INDEXED error, indicating the repo has no CodeWiki documentation yet.
| Parameter | Type | Required | Description |
|---|---|---|---|
repo_url | string | Yes | Full URL, owner/repo shorthand, or bare keyword |
Uses Playwright to navigate CodeWiki's search page, click "Request repository", fill in the GitHub URL, and submit. Returns confirmation when successful.
Example
repo_url: Snowflake-Labs/agent-world-model
Response Format
All tools return structured JSON with a consistent envelope:
Success
{
"status": "ok",
"data": "The response content...",
"repo_url": "https://github.com/owner/repo",
"query": "How does X work?",
"content_hash": "a1b2c3d4e5f67890",
"idempotency_key": "owner/repo::a1b2c3d4e5f67890",
"meta": {
"elapsed_ms": 450,
"char_count": 3200,
"attempt": 1,
"max_attempts": 2,
"truncated": false
}
}
Error
{
"status": "error",
"code": "TIMEOUT",
"message": "Page took too long to load.",
"repo_url": "https://github.com/owner/repo",
"meta": {
"elapsed_ms": 60000,
"attempt": 2,
"max_attempts": 2
}
}
Error Codes
| Code | Description |
|---|---|
VALIDATION | Invalid input parameters |
TIMEOUT | Page or response took too long |
DRIVER_ERROR | Playwright/browser error |
NO_CONTENT | Page rendered but no content found |
NOT_INDEXED | Repository is not yet indexed by CodeWiki — use codewiki_request_indexing to submit it |
RATE_LIMITED | Too many requests for this repo — wait and retry |
INPUT_NOT_FOUND | Chat input element not found on page |
INTERNAL | Unexpected internal error |
RETRY_EXHAUSTED | All retry attempts failed |