# `MCP004` Get test by ID {bdg-ref-info}`mcp | tools ` {bdg-ref-info}`mcp | query ` > I would like to retrieve the full details of a functional test when I know its ID. > This helps me understand test procedures, what requirements they validate, and what > steps are involved before suggesting modifications or creating similar tests. > The user shall be able to query a test by its unique identifier. The MCP server shall expose a tool named `get_test` that accepts a test ID as a string parameter and returns the full test details. The response shall include all available fields: - `id`: The unique identifier - `short`: The short description (if present) - `long`: The full description - `ref`: List of requirement IDs this test validates - `source_file`: Path to the specification file this test was loaded from - `initial`: Initial state description (if present) - `prereq`: List of prerequisite test IDs (if present) - `steps`: List of test steps, each containing: - `action`: The action description - `run`: Shell command to execute (if present) - `expected`: Expected output (if present) - `sample`: Sample data (if present) - `sample_lang`: Language of sample data (if present) - `comments`: List of comments about this test (if any) - `code_references`: List of code locations tagged with this test ID (if any), each with `file`, `line`, `symbol` (or null for free references), and `is_test` (whether the tagged symbol is an automated test implementation) If the test ID does not exist, the tool shall return an error message. :::{dropdown} Properties :icon: note :color: primary __author__: Claude __since__: `0.2.0` ::: :::{dropdown} Tested by :open: :icon: check-circle-fill :color: success - [`TMCP007` get_test with minimal fields](/tests/TMCP007) - [`TMCP008` get_test with all fields](/tests/TMCP008) - [`TMCP009` get_test errors on unknown ID](/tests/TMCP009) - [`TMCP010` get_test errors on non-test ID](/tests/TMCP010) - [`TMCP044` get_test includes code references with is_test flag](/tests/TMCP044) ::: :::{dropdown} Source :icon: file-code :color: info __Source file__: [`specs/mcp/query.yaml`](https://github.com/agagniere/speky/blob/master/specs/mcp/query.yaml) __Loaded from__: [`speky_mcp`](https://github.com/agagniere/speky/blob/master/specs/mcp/mcp.toml) __Implemented in:__ {fab}`python` [`handle_get_test`](https://github.com/agagniere/speky/blob/master/python/speky_mcp/tools.py#L62) :::