testmo_list_automation_sources
List CI/CD integration sources for a Testmo project, with optional filtering by retired status, pagination, and related entity expansion.
Instructions
List automation sources in a project (CI/CD integrations).
Args: project_id: The project ID. is_retired: Filter by retired status (optional). page: Page number (default: 1). per_page: Results per page (default: 100). Valid: 25, 50, 100. expands: Related entities to include.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | ||
| is_retired | No | ||
| page | No | ||
| per_page | No | ||
| expands | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- testmo/tools/automation.py:7-31 (handler)The main handler function for the 'testmo_list_automation_sources' tool. It is decorated with @mcp.tool() and makes a GET request to /projects/{project_id}/automation/sources with optional query parameters (is_retired, page, per_page, expands).
@mcp.tool() async def testmo_list_automation_sources( project_id: int, is_retired: bool | None = None, page: int = 1, per_page: int = 100, expands: list[str] | None = None, ) -> dict[str, Any]: """List automation sources in a project (CI/CD integrations). Args: project_id: The project ID. is_retired: Filter by retired status (optional). page: Page number (default: 1). per_page: Results per page (default: 100). Valid: 25, 50, 100. expands: Related entities to include. """ params: dict[str, Any] = {"page": page, "per_page": per_page} if is_retired is not None: params["is_retired"] = is_retired if expands: params["expands"] = ",".join(expands) return await _request( "GET", f"/projects/{project_id}/automation/sources", params=params ) - testmo/tools/automation.py:7-7 (registration)Registration of the tool via the @mcp.tool() decorator, which registers 'testmo_list_automation_sources' with the FastMCP server.
@mcp.tool() - testmo/client.py:25-49 (helper)The _request helper function used by the handler to execute the HTTP request against 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/server.py:6-6 (helper)The FastMCP server instance ('mcp') used as the decorator target for registering all tools.
mcp = FastMCP("testmo-mcp")