get_components
Retrieve components from Devici for threat modeling with pagination support to manage large datasets.
Instructions
Get components from Devici with pagination
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_components"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| page | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/devici_mcp_server/server.py:121-127 (handler)MCP tool handler and registration for 'get_components'. This is the primary implementation exposed by the MCP server, which delegates to the API client.
@mcp.tool() async def get_components(limit: int = 20, page: int = 0) -> str: """Get components from Devici with pagination""" async with create_client_from_env() as client: result = await client.get_components(limit=limit, page=page) return str(result) - Supporting API client method that makes the HTTP GET request to '/components/' endpoint to fetch components with pagination.
async def get_components(self, limit: int = 20, page: int = 0) -> Dict[str, Any]: """Get all components.""" params = {"limit": limit, "page": page} return await self._make_request("GET", "/components/", params=params)