Skip to main content
Glama
paulieb89

What Do They Know

build_request_url

Read-onlyIdempotent

Build a URL pre-filled with Freedom of Information request details for a UK public authority, including optional title, body, and tags.

Instructions

Build a prefilled WhatDoTheyKnow request URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
authority_slugYes
titleNo
default_letterNo
bodyNo
tagsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
authority_slugYes
urlYes

Implementation Reference

  • The tool handler for 'build_request_url'. Builds a prefilled WhatDoTheyKnow request URL from optional title, default_letter, body, and tags parameters. Registered with the @mcp.tool decorator with tags {'public', 'compose'}.
    @mcp.tool(
        annotations=ToolAnnotations(
            readOnlyHint=True,
            idempotentHint=True,
            openWorldHint=True,
        ),
        tags={"public", "compose"},
    )
    def build_request_url(
        authority_slug: str,
        title: str | None = None,
        default_letter: str | None = None,
        body: str | None = None,
        tags: list[str] | None = None,
    ) -> NewRequestLink:
        """Build a prefilled WhatDoTheyKnow request URL."""
        params: dict[str, str] = {}
        if title:
            params["title"] = title
        if default_letter:
            params["default_letter"] = default_letter
        if body:
            params["body"] = body
        if tags:
            params["tags"] = " ".join(tags)
    
        query = urlencode(params, doseq=False)
        url = f"{BASE_URL}/new/{authority_slug}"
        if query:
            url = f"{url}?{query}"
    
        return NewRequestLink(authority_slug=authority_slug, url=url)
  • Pydantic model used as the return type for build_request_url, containing authority_slug and the constructed URL.
    class NewRequestLink(BaseModel):
        authority_slug: str
        url: HttpUrl
  • server.py:242-249 (registration)
    Registration of build_request_url as an MCP tool via the @mcp.tool decorator, marking it as read-only, idempotent, and open-world.
    @mcp.tool(
        annotations=ToolAnnotations(
            readOnlyHint=True,
            idempotentHint=True,
            openWorldHint=True,
        ),
        tags={"public", "compose"},
    )
Behavior3/5

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

Annotations already indicate readOnlyHint and idempotentHint, so the description is not burdened to repeat those. It adds the key behavioral detail that the URL is 'prefilled', implying the tool constructs a link with parameters populated. However, it does not clarify whether the tool actually sends a request or just generates a URL, which is a marginal gap given the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence with no wasted words. However, given the complexity of the tool (5 parameters, no schema descriptions), the extreme brevity results in under-specification. The sentence is front-loaded but fails to provide necessary context, which detracts from conciseness as a virtue.

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?

With 5 parameters, zero schema descriptions, and an output schema that is not explained, the description is highly incomplete. It does not mention what the returned URL looks like, how parameters map to URL components, or any constraints. The annotations cover safety but not functionality, leaving significant gaps 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.

Parameters1/5

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

The input schema has 0% description coverage, meaning the description must explain parameter semantics. However, the description only states 'Build a prefilled WhatDoTheyKnow request URL' and provides no information about parameters like authority_slug, title, default_letter, body, or tags. This leaves the agent without any understanding of how to use the parameters correctly.

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 clearly states the tool builds a prefilled WhatDoTheyKnow request URL, specifying the action (build), resource (URL), and context (prefilled, WhatDoTheyKnow). It distinguishes itself from siblings like create_request_record, which handles actual record creation, and search tools, making its purpose unambiguous.

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 offers no guidance on when to use this tool versus alternatives. Sibling tools like create_request_record suggest a related but distinct function (creating a request record vs. generating a URL), but the description does not explicitly state the appropriate use case or exclude scenarios like direct submission.

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/paulieb89/whatdotheyknow-mcp'

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