Skip to main content
Glama
legislation.gov.uk MCP Server

legislation.gov.uk MCP Server

by legislation

get_resource

Read-onlyIdempotent

Fetches guides, reference material, and documentation by URI when direct MCP resource access is unavailable, so agents can retrieve legislation-specific help and schemas.

Instructions

Fetch a resource by URI. For agents that cannot access MCP resources directly, use this tool to retrieve guides, reference material, and documentation.

Available resources:

  • guide://getting-started — Overview and quick start

  • guide://troubleshooting — Common errors and edge cases

  • cookbook://index — Index of all cookbook recipes

  • cookbook://check-extent — How to check geographical extent

  • cookbook://point-in-time-version — How to retrieve historical versions

  • cookbook://semantic-search-workflow — Semantic search step-by-step (needs the semantic search backend)

  • types://guide — All UK legislation type codes (ukpga, uksi, etc.)

  • types://data — Type codes as JSON

  • years://regnal — Regnal year identifiers for pre-1963 legislation

  • text://format-guide — Plain text output format documentation

  • clml://schema-guide — CLML XML structure reference

  • clml://metadata/extent — Geographical extent in CLML

  • atom://feed-guide — Atom feed format for search results

  • json://search-response — search_legislation response format

  • json://metadata-response — get_legislation_metadata response format

  • json://table-of-contents-response — get_legislation_table_of_contents response format

  • json://semantic-search-response — search_legislation_semantic response format

  • json://semantic-section-response — search_legislation_sections_semantic response format

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "uri": "<uri>"
    },
    "name": "get_resource"
  }
}

Input Schema

NameRequiredDescriptionDefault
uriYesResource URI (e.g. `guide://getting-started`, `types://guide`)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, and openWorldHint=false, so safety and repeatability are covered structurally. The description adds that content is documentation-oriented rather than data retrieval, but says nothing about what an unknown or malformed URI yields or what format (text/markdown/JSON) any given resource returns.

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 purpose and the access-condition caveat are front-loaded in the first two sentences, before the catalog. The catalog is long, but every line carries distinct routing information that the schema does not encode, so the length is earned rather than padded.

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

Completeness4/5

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

For a one-parameter, fully documented read whose annotations already cover the safety profile, the description is close to sufficient; the resource catalog effectively answers 'what do I get back?' in place of an output schema. The remaining gap is error behavior for invalid URIs and whether the catalog is exhaustive or illustrative.

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 coverage is 100% and the schema supplies an example, so the baseline is 3. The description goes beyond it by enumerating 18 concrete valid URI values with a one-line note on each, effectively supplying the enum the schema lacks — though it does not state whether values outside that list are rejected or partially matched.

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 first sentence gives a specific verb and resource ('Fetch a resource by URI'), and the second scopes it to agents lacking direct MCP resource access. The 18-entry catalog makes it unmistakable that this retrieves static documentation, not legislation records, so it is trivially separable from the legislation-search siblings.

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?

It states the operative condition clearly ('For agents that cannot access MCP resources directly, use this tool') and maps each URI to the need it satisfies, which is effective routing guidance. It stops short of an explicit exclusion — nothing says, for example, that legislation text or metadata should come from get_legislation/get_legislation_metadata rather than a resource.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.