Skip to main content
Glama
TheOneTrueNiz

Grokipedia MCP Server

get_page

Read-onlyIdempotent

Retrieve complete Grokipedia articles with metadata, content previews, and citations for reading, overviews, and source verification.

Instructions

Get complete Grokipedia page with metadata, content preview, and citations.

Use for: reading articles, getting overviews, checking citations and sources. Returns: title, description, content preview (truncated), citations list. Tips: Use get_page_content for full untruncated content. Slug comes from search results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
slugYesUnique slug identifier of the page to retrieve
max_content_lengthNoMaximum length of content to return (default: 5000)

Implementation Reference

  • The implementation of the get_page tool, which fetches a page from Grokipedia.
    async def get_page(
        slug: Annotated[str, Field(description="Unique slug identifier of the page to retrieve")],
        max_content_length: Annotated[int, Field(description="Maximum length of content to return (default: 5000)", ge=100)] = 5000,
        ctx: Context[ServerSession, AppContext] | None = None,
    ) -> CallToolResult:
        """Get complete Grokipedia page with metadata, content preview, and citations.
    
        Use for: reading articles, getting overviews, checking citations and sources.
        Returns: title, description, content preview (truncated), citations list.
        Tips: Use get_page_content for full untruncated content. Slug comes from search results.
        """
        if ctx is None:
            raise ValueError("Context is required")
    
        await ctx.debug(f"Fetching page: '{slug}'")
    
        try:
            client = ctx.request_context.lifespan_context.client
            result = await client.get_page(slug=slug, include_content=True)
    
            if not result.found or result.page is None:
                await ctx.warning(f"Page not found: '{slug}', searching for alternatives")
                search_result = await client.search(query=slug, limit=5)
                if search_result.results:
                    suggestions = [f"{r.title} ({r.slug})" for r in search_result.results[:3]]
                    await ctx.info(f"Found {len(search_result.results)} similar pages")
                    raise ValueError(
                        f"Page not found: {slug}. Did you mean one of these? {', '.join(suggestions)}"
                    )
                raise ValueError(f"Page not found: {slug}")
    
            await ctx.info(f"Retrieved page: '{result.page.title}' ({slug})")
            
            page = result.page
            content_len = len(page.content) if page.content else 0
            is_truncated = content_len > max_content_length
            
            text_parts = [
                f"# {page.title}",
                "",
                f"**Slug:** {page.slug}",
            ]
            
            if page.description:
                text_parts.extend(["", f"**Description:** {page.description}", ""])
            
            if page.content:
                preview_length = min(1000, max_content_length)
  • The registration of the get_page tool using the @mcp.tool decorator.
    @mcp.tool(
        annotations=ToolAnnotations(
            readOnlyHint=True,
            destructiveHint=False,
            idempotentHint=True
        )
    )
Behavior4/5

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

Annotations declare readOnly/idempotent/destructive profile. Description adds crucial behavioral context: content is 'truncated' (distinguishing from full content sibling) and specifies exact return fields (title, description, citations list). Could enhance with rate limit or caching notes, but adequately supplements annotations.

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?

Efficiently structured with clear sections (implied purpose, Use for, Returns, Tips). Zero redundancy; every line provides actionable guidance. Front-loads core purpose in first sentence.

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?

For a 2-parameter read operation without output schema, description comprehensively documents return structure and differentiates from 5 sibling tools. No gaps given tool complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema has 100% coverage documenting both slug and max_content_length. Description adds semantic value by specifying 'Slug comes from search results'—guidance not present in schema about parameter provenance—exceeding baseline expectations for high-coverage schemas.

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?

Opens with specific verb+resource ('Get complete Grokipedia page') and explicitly scopes the operation to 'metadata, content preview, and citations'. Clearly distinguishes from sibling get_page_content by noting this returns truncated preview content.

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 'Use for' section listing appropriate contexts (reading articles, overviews, checking citations). Names specific alternative 'Use get_page_content for full untruncated content' and notes prerequisite 'Slug comes from search results'.

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/TheOneTrueNiz/mcp-grokipedia-tool'

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