Skip to main content
Glama

get_components_by_canvas

Retrieve components for a specific canvas in threat modeling to analyze security elements and relationships.

Instructions

Get components for a specific canvas

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
canvas_idYes

Implementation Reference

  • The main handler function for the 'get_components_by_canvas' MCP tool. Decorated with @mcp.tool() for automatic registration and schema inference. It creates an API client instance and delegates to the client's get_components_by_canvas method, returning the result as a string.
    @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)
  • Supporting API client method that performs the actual HTTP GET request to the Devici API endpoint /components/canvas/{canvas_id} to retrieve components for the given canvas ID.
    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}")
  • The @mcp.tool() decorator registers the function as an MCP tool named 'get_components_by_canvas', inferring input schema from parameters and docstring.
    @mcp.tool()

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/geoffwhittington/devici-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server