Armature.MCP.Analytics.MCP (armature_mcp_analytics v0.1.0)

Copy Markdown View Source

Framework-neutral helpers for JSON-style MCP tool definitions and arguments.

Summary

Functions

Decorates one JSON-style MCP tool map. Existing telemetry properties are preserved.

Validates arguments for the request_capability helper tool.

Adds the default-on request_capability tool unless it already exists.

Separates Armature telemetry from handler arguments.

Returns the framework-neutral request_capability MCP tool definition.

Returns the Armature telemetry JSON Schema fragment.

Functions

decorate_tool(tool)

@spec decorate_tool(map()) :: map()

Decorates one JSON-style MCP tool map. Existing telemetry properties are preserved.

handle_request_capability(arg1)

@spec handle_request_capability(map()) :: {:ok, map()} | {:error, :invalid_capability}

Validates arguments for the request_capability helper tool.

maybe_add_request_capability(tools)

@spec maybe_add_request_capability([map()]) :: [map()]

Adds the default-on request_capability tool unless it already exists.

prepare_arguments(arguments, tool_definition \\ nil)

@spec prepare_arguments(map(), map() | nil) :: {map(), map()}

Separates Armature telemetry from handler arguments.

If the original tool schema already owns a top-level telemetry property, the arguments are returned untouched to avoid changing that tool's contract.

request_capability_tool()

@spec request_capability_tool() :: map()

Returns the framework-neutral request_capability MCP tool definition.

telemetry_schema()

@spec telemetry_schema() :: map()

Returns the Armature telemetry JSON Schema fragment.