function.json (bicycle.function/v1 — function.json)
Synced from bicycle-studio-api
Source: _generated/function-manifest.md in the local directory context-collection (not yet on origin/platform), synced 2026-09-26. Do not edit this page here; change the source and run yarn sync:studio.
That source is itself generated (by arch/context-collection/build.py from data-app-runtime b21a421 bicycle_exec/schemas/bicycle.function.v1.schema.json); change its source and re-run its build.
Required: schema, name, input_schema, output_schema, capabilities.
| field | type | notes |
|---|---|---|
schema | ||
name | string | Registry key within the scope; <= 56 chars so the MCP tool name fn_<name> is <= 64. |
title | string | |
kind | enum code/llm/agent/lookup/classify | Contract 1.1. code: entrypoint + image + *.py, quality gate tests[]. llm / agent: no code, no image; quality gate evals. Contract 1.2 (additive): lookup (one read-only connector tool, run as the viewer) and classify (a closed label set); no code, run remotely, evals optional. Immutable per function name. |
entrypoint | string | module:function, e.g. main:handler. Signature: def handler(input: dict, ctx) -> dict. |
image | string | Catalog name and major, e.g. bda-python:3. The lock pins the digest. v1 accepts only bda-python:3. |
input_schema | jsonSchemaObject | |
output_schema | jsonSchemaObject | |
capabilities | array | |
resources | object | |
resources.class | enum fn-xs/fn-small/fn-medium | |
resources.job | enum small/medium/large | Job path (workflow callers only in v1). Mutually exclusive with class. |
timeout_ms | integer | <= 30000 when mode is sync; <= 900000 on the warm path. Longer runs take the Job path. |
mode | enum sync/async | async = :submit + poll (the v1 kit default). sync is flag-gated until on-demand nodes exist. |
deterministic | boolean | true enables caching of workflow function nodes; the validator then lints wall-clock and unseeded randomness (422 volatile_in_deterministic). |
visibility | object | |
visibility.audience | enum private/app/tenant/bicycle | |
visibility.expose | object | |
visibility.expose.mcp | boolean | |
visibility.expose.agents | boolean | |
visibility.expose.workflows | boolean | |
visibility.expose.apps | boolean | |
tests | array | Required for kind code; optional for llm and agent (evals are their gate). |
llm | object | kind llm only: one structured model call. prompt/system are package files; the prompt uses {{input<pointer>}} only. |
llm.model | modelId | |
llm.prompt | promptPath | |
llm.system | promptPath | |
llm.effort | enum low/medium/high | |
llm.max_output_tokens | integer | |
llm.on_invalid | enum repair_once/fail | |
llm.max_cost_usd | number | |
agent | object | kind agent only: a Bicycle agent by ref, or an inline agent-spec/v1 (exactly one). |
agent.ref | string | |
agent.spec | object | |
lookup | object | kind lookup only: one read-only connector tool, run as the viewer on the viewer's own connection. config is closed per tool by the executor. |
lookup.connector | string | |
lookup.tool | string | |
lookup.access | ||
lookup.config | object | |
classify | object | kind classify only: one text field of the input into a closed label set. The text is classified, never put into instructions. |
classify.labels | array | |
classify.multi_label | boolean | |
classify.instructions | string | |
classify.text_field | string | |
grants | object | kind agent only: what the agent may use, intersected with the deployment's and the tenant's connections. |
grants.connectors | array | |
grants.functions | array | |
budgets | object | kind agent only. |
budgets.max_steps | integer | |
budgets.max_cost_usd | number | |
budgets.max_wall_s | integer | |
evals | object | Eval suites in the package. Opt-in (DECISIONS #32): an empty list or no block at all is valid; an eval policy in Studio is what makes them a publish gate. |
evals.suites | array | |
docs | object | |
docs.summary | string | |
docs.description | string | <= 1000 when expose.mcp. |
docs.examples | array |
kind: lookup is RETIRED (DECISIONS #42): do not create one; read a connection with an agent that has access to it. agent.spec is typed as a bare object here: its fields are in 04-agents.md until agent-spec/v1 has a published schema (MCP-GITHUB-CHANGES.md Rank 9).