Skip to main content
Glama
mugoosse

Sitemap MCP Server

parse_sitemap_content

Extract and process sitemap data from XML or text content to retrieve structured information, with optional inclusion of page details for comprehensive analysis.

Instructions

Parse a sitemap directly from its XML or text content

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesThe content of the sitemap (XML, text, etc.)
include_pagesNoWhether to include page details in the response

Implementation Reference

  • The main handler function for the 'parse_sitemap_content' tool. It is decorated with @mcp.tool, defining the tool schema inline via Pydantic Field annotations. Parses sitemap content using sitemap_from_str from the usp library and returns a JSON-serialized dictionary representation of the sitemap.
    @mcp.tool(description="Parse a sitemap directly from its XML or text content")
    async def parse_sitemap_content(
        ctx: Context,
        content: str = Field(
            ..., description="The content of the sitemap (XML, text, etc.)"
        ),
        include_pages: bool = Field(
            False, description="Whether to include page details in the response"
        ),
    ) -> str:
        """Parse a sitemap from its content.
    
        This tool parses a sitemap directly from its XML or text content and returns a structured representation.
        """
        try:
            logger.info("Parsing sitemap from content")
            parsed_sitemap = sitemap_from_str(content)
            return safe_json_dumps(parsed_sitemap.to_dict(with_pages=include_pages))
        except Exception as e:
            error_msg = f"Error parsing sitemap content: {str(e)}"
            logger.error(error_msg)
            return safe_json_dumps({"error": error_msg})
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool parses sitemap content but doesn't mention error handling, output format, performance implications, or any side effects. For a tool with 2 parameters and no output schema, this is inadequate, as it leaves key behavioral traits unspecified.

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?

The description is a single, efficient sentence: 'Parse a sitemap directly from its XML or text content.' It is front-loaded with the core action and resource, with no wasted words. This makes it highly concise and well-structured for quick understanding.

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

Completeness2/5

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

Given the tool's complexity (2 parameters, no output schema, no annotations), the description is incomplete. It lacks details on what the parsed output looks like, how errors are handled, or any behavioral context. Without annotations or an output schema, the description should provide more context to be fully helpful, but it falls short.

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?

The schema description coverage is 100%, so the input schema already documents both parameters ('content' and 'include_pages') thoroughly. The description adds no additional semantic details beyond what the schema provides, such as examples or constraints. Thus, it meets the baseline of 3, as the schema handles the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Parse a sitemap directly from its XML or text content.' It specifies the verb ('parse') and resource ('sitemap'), and mentions the input format ('XML or text content'). However, it doesn't explicitly differentiate from sibling tools like 'get_sitemap_pages' or 'get_sitemap_tree,' which might have overlapping functionality, so it doesn't reach a 5.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'get_sitemap_pages' or 'get_sitemap_stats,' nor does it specify prerequisites or exclusions. This lack of context leaves the agent without clear usage instructions, scoring a 2 for minimal guidance.

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

Related 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/mugoosse/sitemap-mcp-server'

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