Skip to main content
Glama
adrighem

Domoticz MCP Server

by adrighem

get_camera_snapshot

Retrieve a camera snapshot as a base64 encoded string by providing the camera's device index.

Instructions

Get a camera snapshot as a base64 encoded string.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idxYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The actual handler function for the 'get_camera_snapshot' tool. It takes a camera idx, fetches the snapshot image from Domoticz, base64-encodes the content, and returns it as JSON.
    @mcp.tool()
    async def get_camera_snapshot(idx: int) -> str:
        """Get a camera snapshot as a base64 encoded string."""
        async with create_client() as client:
            response = await _do_request(client, "GET", f"{DOMOTICZ_BASE_URL}/camsnapshot.jpg?idx={idx}")
            img_b64 = base64.b64encode(response.content).decode("utf-8")
            return json.dumps({"status": "OK", "result": img_b64})
  • The tool is registered via the @mcp.tool() decorator on line 919, which is the standard FastMCP registration mechanism.
    @mcp.tool()
  • The function signature defines the input schema: 'idx' is an integer (the camera index). Returns a JSON string containing 'status' and 'result' (base64 image).
    async def get_camera_snapshot(idx: int) -> str:
  • The base64 module is used to encode the camera snapshot binary data into a base64 string.
    import base64
  • The _do_request helper is used by get_camera_snapshot to perform the HTTP GET request to the Domoticz camsnapshot.jpg endpoint.
    async def _do_request(client: httpx.AsyncClient, method: str, url: str, **kwargs) -> httpx.Response:
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It only states the output format but does not disclose side effects, permissions needed, or whether the snapshot is temporary. No behavioral traits beyond the basic operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence of 10 words is concise and front-loaded. However, it may be too brief, sacrificing necessary detail for brevity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite having an output schema (not shown), the description only mentions base64 string but not the overall response structure. With 0% schema coverage and no annotations, the description fails to provide enough context for the agent to invoke correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has one required integer parameter 'idx' with no description (0% coverage). The description does not explain what 'idx' represents (e.g., camera ID or index), leaving the agent to guess.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'get' and the resource 'camera snapshot', and specifies the output format as base64 encoded string. It distinguishes from sibling 'get_cameras' which lists cameras.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool, what context is appropriate, or how it differs from alternatives. The description does not mention prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/adrighem/domoticz-mcp'

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