Skip to main content
Glama
TheOneTrueNiz

Grokipedia MCP Server

get_page_content

Read-onlyIdempotent

Retrieve complete article content from Grokipedia for comprehensive research and reading. Use this tool to access full articles with title and raw markdown content for detailed information gathering.

Instructions

Get full article content from Grokipedia (larger than get_page preview).

Use for: reading complete articles, comprehensive research, when you need all content. Returns: title, full content (up to max_length), content_length. Tips: Set max_length higher for very long articles. Returns raw markdown.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
slugYesUnique slug identifier of the page to retrieve content from
max_lengthNoMaximum length of content to return (default: 10000)

Implementation Reference

  • The get_page_content tool is registered using @mcp.tool and implemented as an async function in server.py. It fetches full article content from the Grokipedia API and supports content truncation and length limiting.
    @mcp.tool(
        annotations=ToolAnnotations(
            readOnlyHint=True,
            destructiveHint=False,
            idempotentHint=True
        )
    )
    async def get_page_content(
        slug: Annotated[str, Field(description="Unique slug identifier of the page to retrieve content from")],
        max_length: Annotated[int, Field(description="Maximum length of content to return (default: 10000)", ge=100)] = 10000,
        ctx: Context[ServerSession, AppContext] | None = None,
    ) -> CallToolResult:
        """Get full article content from Grokipedia (larger than get_page preview).
    
        Use for: reading complete articles, comprehensive research, when you need all content.
        Returns: title, full content (up to max_length), content_length.
        Tips: Set max_length higher for very long articles. Returns raw markdown.
        """
        if ctx is None:
            raise ValueError("Context is required")
    
        await ctx.debug(f"Fetching content for: '{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}'")
                raise ValueError(f"Page not found: {slug}")
    
            page = result.page
            content = page.content or ""
            content_len = len(content)
            is_truncated = content_len > max_length
            
            if is_truncated:
                content = content[:max_length]
                await ctx.warning(
                    f"Content truncated from {content_len} to {max_length} chars. "
                    f"Use max_length parameter to adjust."
                )
            
            await ctx.info(f"Retrieved content for: '{page.title}' ({content_len} chars)")
            
            text_output = f"# {page.title}\n\n{content}"
            if is_truncated:
                text_output += f"\n\n... (truncated at {max_length} of {content_len} chars)"
            
            structured = {
                "slug": page.slug,
                "title": page.title,
                "content": content,
                "content_length": len(content),
            }
            
            if is_truncated:
                structured["_truncated"] = True
                structured["_original_length"] = content_len
            
            return CallToolResult(
                content=[TextContent(type="text", text=text_output)],
                structuredContent=structured,
            )
    
        except GrokipediaNotFoundError as e:
            await ctx.error(f"Page not found: {e}")
            raise ValueError(f"Page not found: {slug}") from e
        except GrokipediaBadRequestError as e:
            await ctx.error(f"Bad request: {e}")
            raise ValueError(f"Invalid page slug: {e}") from e
        except GrokipediaNetworkError as e:
            await ctx.error(f"Network error: {e}")
            raise RuntimeError(f"Failed to connect to Grokipedia API: {e}") from e
        except GrokipediaAPIError as e:
            await ctx.error(f"API error: {e}")
            raise RuntimeError(f"Grokipedia API error: {e}") from e
Behavior4/5

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

While annotations confirm read-only/idempotent status, the description adds crucial behavioral context: it discloses the return structure (title, full content, content_length), format (raw markdown), and operational tip about adjusting max_length for long articles—essential given the lack of an output schema.

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?

Uses an efficient structured format (main description, Use for, Returns, Tips) with zero filler. Every sentence conveys distinct information about scope, usage, output, or configuration.

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?

Given the lack of output schema, the description comprehensively documents return values and format. Combined with complete schema coverage and clear sibling differentiation, it provides sufficient context for an agent to invoke the tool correctly.

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?

With 100% schema coverage establishing a baseline of 3, the description adds meaningful usage semantics for max_length by advising to 'set max_length higher for very long articles' and explaining its effect on returned content ('up to max_length').

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 opens with a specific verb-resource combination ('Get full article content from Grokipedia') and immediately distinguishes itself from the sibling tool get_page by noting it returns 'larger than get_page preview,' clearly establishing its scope relative to alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit 'Use for' section listing specific scenarios (reading complete articles, comprehensive research). Implicitly contrasts with get_page via size comparison, though it stops short of explicitly stating 'use get_page instead for previews.'

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