Skip to main content
Glama
paulieb89

What Do They Know

update_request_state

Destructive

Update the status of a Freedom of Information request to reflect your assessment of its state.

Instructions

Update the user-assessed state of a request through the experimental write API.

Requires WDTK_API_KEY in the server environment.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
request_idYes
stateYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The tool handler function 'update_request_state' decorated with @mcp.tool. Takes request_id and state, checks for WDTK_API_KEY, validates state via UpdateRequestStatePayload, and POSTs to the WDTK write API endpoint.
    @mcp.tool(
        annotations=ToolAnnotations(destructiveHint=True, openWorldHint=True),
        tags={"write", "admin"},
    )
    @_timed_tool
    async def update_request_state(
        request_id: int,
        state: str,
        ctx: Context = CurrentContext(),
    ) -> dict[str, Any]:
        """
        Update the user-assessed state of a request through the experimental write API.
    
        Requires WDTK_API_KEY in the server environment.
        """
        api_key = os.getenv("WDTK_API_KEY")
        if not api_key:
            return {"error": "Write API unavailable: WDTK_API_KEY not configured. Requires an authority-level key from the WhatDoTheyKnow admin interface."}
        payload = UpdateRequestStatePayload(state=state)
        await ctx.info(f"Updating request {request_id} to state={state}")
        return await wdtk.post_form_json(
            f"/api/v2/request/{request_id}/update.json",
            api_key=api_key,
            json_payload=payload.model_dump(mode="json"),
        )
  • Pydantic model UpdateRequestStatePayload with a single 'state' field validated against allowed values: waiting_response, rejected, successful, partially_successful.
    class UpdateRequestStatePayload(BaseModel):
        state: str = Field(pattern="^(waiting_response|rejected|successful|partially_successful)$")
  • server.py:419-423 (registration)
    Tool registered via @mcp.tool decorator with annotations=ToolAnnotations(destructiveHint=True, openWorldHint=True) and tags={'write', 'admin'}. Also wrapped with @_timed_tool for metrics.
    @mcp.tool(
        annotations=ToolAnnotations(destructiveHint=True, openWorldHint=True),
        tags={"write", "admin"},
    )
Behavior3/5

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

Annotations already provide destructiveHint: true and openWorldHint: true. The description adds that the tool is experimental and requires a specific API key, which supplements behavioral understanding. However, it doesn't detail the exact effects of updating the state or whether changes are reversible.

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

Conciseness4/5

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

The description is succinct at two sentences without unnecessary words. It could be better structured by listing parameters, but it is still efficiently formatted.

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 presence of an output schema, the description need not define return values. However, it lacks crucial context for the state parameter (e.g., allowed values or typical usage), and the experimental nature is noted but not elaborated.

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?

With 0% schema description coverage, the description should explain the two parameters (request_id and state), but it does not. The description adds no meaning beyond the bare schema, leaving the agent to guess what values 'state' can take.

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 'Update the user-assessed state of a request', specifying the verb (update), resource (request), and what aspect is modified (state). This differentiates it from sibling tools like create_request_record or get_request_feed_items.

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

Usage Guidelines3/5

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

The description mentions it's an 'experimental write API' and requires 'WDTK_API_KEY', providing some context for use. However, it does not specify when to prefer this over alternatives or state any exclusion conditions.

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