# `TMCP043` get_requirement includes code references When code sources are declared in the manifest and a requirement has been tagged in source code, `get_requirement` shall include a `code_references` field listing the file, line, and symbol of each tagged location. :::{dropdown} Is a test for :open: :icon: check-circle-fill :color: primary [`MCP003` Get requirement by ID](/requirements/MCP003) ::: :::{dropdown} Automated in :open: :icon: check-circle-fill :color: success {fab}`python` [`test_get_requirement_with_code_references`](https://github.com/agagniere/speky/blob/master/tests/test_mcp_server.py#L743) ::: :::{dropdown} Source :icon: file-code :color: info __Source file__: [`specs/mcp/test_12.yaml`](https://github.com/agagniere/speky/blob/master/specs/mcp/test_12.yaml) __Loaded from__: [`speky_mcp`](https://github.com/agagniere/speky/blob/master/specs/mcp/mcp.toml) ::: ## Initial state The expected state is the final state of [`TMCP003` Initialize the MCP server](/tests/TMCP003) ## Procedure ### Step 1 Call `get_requirement` for a requirement that has a code reference ```json { "id": 2, "jsonrpc": "2.0", "method": "tools/call", "params": { "name": "get_requirement", "arguments": {"id": "RF01"} } } ``` ### Step 2 Verify the response includes a `code_references` field with file, line, and symbol ```json { "id": 2, "jsonrpc": "2.0", "result": { "structuredContent": { "category": "functional", "id": "RF01", "long": "The first requirement", "code_references": [ {"file": "src/feature.py", "line": 5, "symbol": "my_function"} ] } } } ```