Tools

Invoke a tool

Run one MCP tool as the key’s user. The body is the tool’s arguments exactly as its inputSchema describes them (an empty body means no arguments); the response is the tool’s result with the MCP envelope removed — the JSON object the tool produced, or { ..., "media": [{ "type", "mimeType", "data" }] } when it returned an image or audio block (base64 in data). select keeps only the listed dotted paths, through arrays (nodes.id) and, with an explicit * segment, every value of an id-keyed map (assets.*.id), so large listings never leave the server when a few fields are wanted. format=raw answers the bytes of a single media result with its own Content-Type and the JSON metadata in the X-Martini-Tool-Result header. Tool errors keep their MCP error code in code, with the status the code implies. Tools that need workflows (Actions) access answer TOOL_NOT_FOUND for callers without it, as the MCP does. A run key (mtn_run_…, minted for a workflow run’s sandbox) dispatches through that run’s live supervisor — same budgets, fences, and traces as the run’s own tool calls — and answers RUN_NOT_ACTIVE once the run stops.

post/v1/tools/{name}

Request

  • Base URL: https://api.martini.film
  • URL: https://api.martini.film/v1/tools/{name}
  • Auth: HTTP bearer

Path parameters

namestring required

The tool name, as GET /v1/tools lists it.

Query parameters

selectstring

Comma-separated dotted field paths to keep in the JSON result (segments of letters, digits, _, -, or a lone *; at most 64). Arrays are traversed element-wise; a * segment fans out over every value of an object (keys kept) or every element of an array, e.g. assets.*.id on an id-keyed map. Paths that match nothing are dropped.

format'json' | 'raw'

json (default) answers JSON; raw answers the bytes of a result that is exactly one media block, or NOT_RAW_ELIGIBLE.

Request body

object required

Response

The tool result: its JSON object (projected by select when given), or the raw media bytes with format=raw.

unknown required

Changes

No recorded changes to this operation across all 1 revision of this API.