# `TMCP012` search_requirements filtered by tag The user shall be able to filter requirements by tag and receive only requirements matching that exact tag. :::{dropdown} Is a test for :open: :icon: check-circle-fill :color: primary [`MCP005` Search and filter requirements](/requirements/MCP005) ::: :::{dropdown} Automated in :open: :icon: check-circle-fill :color: success {fab}`python` [`test_search_by_tag`](https://github.com/agagniere/speky/blob/master/tests/test_mcp_server.py#L365) ::: :::{dropdown} Source :icon: file-code :color: info __Source file__: [`specs/mcp/test_05.yaml`](https://github.com/agagniere/speky/blob/master/specs/mcp/test_05.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 The client calls `search_requirements` with tag `foo` ```json { "id": 2, "jsonrpc": "2.0", "method": "tools/call", "params": { "name": "search_requirements", "arguments": {"tag": "foo"} } } ``` ### Step 2 Verify only requirements tagged with `foo` are returned. RF04 must not appear as it has no tags. ```json { "id": 2, "jsonrpc": "2.0", "result": { "structuredContent": { "requirements": [ {"category": "non-functional", "id": "RF03", "short": "Number 3", "tags": ["foo", "bar:baz"]} ] } } } ```