Package-level declarations
Types
Host-supplied sink for tools/call audit records. Implementations must be cheap and non-throwing on the calling path — the protocol invokes record synchronously after each call and swallows exceptions so a broken audit backend never fails a tool. The Room-backed implementation lives in the opt-in droid-mcp-audit module; hosts that don't depend on it pay nothing.
The SDK entry point. Built via DroidMcp.builder / Builder, it owns a ToolRegistry and both transports: an always-on InProcessTransport for on-device LLMs (listTools / callTool) and an optional HttpTransport for desktop MCP clients (startServer).
The contract every droid-mcp tool implements. A tool is a single, self-describing capability — its name, description, and parameters are surfaced verbatim through MCP tools/list, and execute services a tools/call.
The JSON Schema primitive type of a ToolParameter. jsonType is the literal string emitted into the tool's inputSchema ("string", "integer", …).
Runtime-permission checks shared by every module's provider object. The SDK never requests permissions (the host app owns its permission UX) — it only inspects what has already been granted, so a tool can decline gracefully.
Uniform shape returned by every special-access module's permissionStatus(context) helper. Lets host apps render permission cards inline (e.g. in chat) before the LLM tries to call a tool, with a single switch over a closed type.
Behavioural hints attached to a tool, mirroring the MCP tools/list annotation fields. They are advisory metadata for clients and LLMs — the SDK does not enforce them — but the HTTP transport's readOnly server mode uses readOnlyHint to decide which tools to expose.
One audited tools/call. Captured by McpProtocolImpl after the tool runs and handed to the host's AuditSink.
Thread-safe collection of registered McpTools, keyed by McpTool.name. Backed by a ConcurrentHashMap so tools can be registered and invoked concurrently. Also tracks a host-controlled runtime gate (see setDisabledTools) that hides/blocks tools without unregistering them.
The outcome of an McpTool.execute call. Exactly one of data / errorMessage is meaningful, selected by isSuccess. The protocol layer maps a result onto the MCP tools/call response: success becomes content, failure becomes an isError: true payload.