testmo_delete_case_attachments
Delete one or more attachments from a test case by specifying the case ID and attachment IDs.
Instructions
Delete one or more attachments from a test case.
Args: case_id: The test case ID. attachment_ids: Array of attachment IDs to delete.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| case_id | Yes | ||
| attachment_ids | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- testmo/tools/attachments.py:112-125 (handler)The handler function that executes the delete case attachments tool. Sends a DELETE request to /cases/{case_id}/attachments with the list of attachment IDs.
@mcp.tool() async def testmo_delete_case_attachments( case_id: int, attachment_ids: list[int], ) -> dict[str, Any]: """Delete one or more attachments from a test case. Args: case_id: The test case ID. attachment_ids: Array of attachment IDs to delete. """ return await _request( "DELETE", f"/cases/{case_id}/attachments", data={"ids": attachment_ids} ) - testmo/tools/attachments.py:112-112 (registration)Registration of the tool via the @mcp.tool() decorator, which registers it with the FastMCP server.
@mcp.tool() - testmo/client.py:25-49 (helper)The _request helper function used by the handler to perform the actual HTTP DELETE request to the Testmo API.
async def _request( method: str, endpoint: str, data: dict[str, Any] | None = None, params: dict[str, Any] | None = None, ) -> dict[str, Any]: async with _get_client() as client: response = await client.request( method=method, url=endpoint, json=data, params=params, ) if response.status_code == 204: return {"success": True} if response.status_code >= 400: try: error_body = response.json() except Exception: error_body = response.text raise RuntimeError( f"Testmo API error {response.status_code}: " f"{json.dumps(error_body) if isinstance(error_body, dict) else error_body}" ) return response.json() - testmo/tools/attachments.py:114-116 (schema)Parameter schema for the tool: case_id (int) and attachment_ids (list of ints).
case_id: int, attachment_ids: list[int], ) -> dict[str, Any]: - testmo-mcp.py:16-23 (registration)The entry point that imports the attachments module, triggering registration of all attachment tools including testmo_delete_case_attachments.
import testmo.tools.attachments # noqa: F401 import testmo.tools.automation # noqa: F401 import testmo.tools.issues # noqa: F401 import testmo.tools.composite # noqa: F401 import testmo.tools.utility # noqa: F401 if __name__ == "__main__": mcp.run(transport="stdio")