list_countermeasures
Identify and filter countermeasures for a project by status and page size using the SD Elements MCP Server, enabling efficient security development lifecycle management.
Instructions
List countermeasures for a project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page_size | No | Number of results per page (optional) | |
| project_id | Yes | The ID of the project | |
| status | No | Filter by countermeasure status |
Implementation Reference
- The main handler function for the 'list_countermeasures' MCP tool. It is decorated with @mcp.tool(), which serves as both the implementation and registration. The function takes project_id and optional filters, queries the SD Elements API via api_client, and returns the result as formatted JSON.@mcp.tool() async def list_countermeasures(ctx: Context, project_id: int, status: Optional[str] = None, page_size: Optional[int] = None, risk_relevant: bool = True) -> str: """List all countermeasures for a project. Use this to see countermeasures associated with a project, not get_project which returns project details.""" global api_client if api_client is None: api_client = init_api_client() params = {} if status is not None: params["status"] = status if page_size is not None: params["page_size"] = page_size params["risk_relevant"] = str(risk_relevant).lower() result = api_client.list_countermeasures(project_id, params) return json.dumps(result, indent=2)