Tools Reference

CodeWiki MCP provides 5 tools for querying open-source repository documentation.

Tools Architecture

graph LR A[codewiki_list_topics] -->|repo_url| R[Keyword Resolver] C[codewiki_read_structure] -->|repo_url| R D[codewiki_read_contents] -->|repo_url| R E[codewiki_search_wiki] -->|repo_url| R F2[codewiki_request_indexing] -->|repo_url| R R -->|owner/repo| B[Browser Singleton] B --> F[Playwright] F --> G[Parser] G --> H[JSON Response] B --> I[TTL Cache]

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:

  1. CodeWiki search scraping — searches codewiki.google for matching repos.
  2. GitHub API fallback v1.3.0 — if CodeWiki returns zero results, queries api.github.com/search/repositories to catch typos (e.g. "fecbook/react" → "facebook/react").
  3. MCP Elicitation — when multiple repos match, interactively asks the user to pick via the MCP Elicitation protocol (requires a supporting client).
  4. 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.

ParameterTypeRequiredDescription
repo_urlstringYesFull 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.

ParameterTypeRequiredDescription
repo_urlstringYesFull 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.

ParameterTypeRequiredDescription
repo_urlstringYesFull URL, owner/repo shorthand, or bare keyword
section_titlestringNoTitle (or partial) of a section to retrieve
offsetintNoSection index to start from (default 0)
limitintNoMax 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.

ParameterTypeRequiredDescription
repo_urlstringYesFull URL, owner/repo shorthand, or bare keyword
querystringYesThe 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.

ParameterTypeRequiredDescription
repo_urlstringYesFull 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

CodeDescription
VALIDATIONInvalid input parameters
TIMEOUTPage or response took too long
DRIVER_ERRORPlaywright/browser error
NO_CONTENTPage rendered but no content found
NOT_INDEXEDRepository is not yet indexed by CodeWiki — use codewiki_request_indexing to submit it
RATE_LIMITEDToo many requests for this repo — wait and retry
INPUT_NOT_FOUNDChat input element not found on page
INTERNALUnexpected internal error
RETRY_EXHAUSTEDAll retry attempts failed