get_components_by_canvas
Retrieve components associated with a specific canvas using the Devici MCP Server. Facilitates threat modeling by organizing and accessing essential elements for effective resource management.
Instructions
Get components for a specific canvas
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| canvas_id | Yes |
Implementation Reference
- src/devici_mcp_server/server.py:137-142 (handler)MCP tool handler function for 'get_components_by_canvas'. This is the primary implementation that executes the tool logic, decorated with @mcp.tool() for registration. It creates an API client and calls the underlying method.@mcp.tool() async def get_components_by_canvas(canvas_id: str) -> str: """Get components for a specific canvas""" async with create_client_from_env() as client: result = await client.get_components_by_canvas(canvas_id) return str(result)
- Helper method in the API client that performs the actual HTTP request to retrieve components by canvas_id from the Devici API.async def get_components_by_canvas(self, canvas_id: str) -> Dict[str, Any]: """Get all components for specific canvas.""" return await self._make_request("GET", f"/components/canvas/{canvas_id}")
- src/devici_mcp_server/server.py:137-137 (registration)The @mcp.tool() decorator registers the get_components_by_canvas function as an MCP tool.@mcp.tool()