Is one function with everything a detail page needs in one round-trip: its…
Is one function with everything a detail page needs in one round-trip: its definition, its 7-day rollup, its trigger, its twenty most recent invocations…
GET /v1/functions/{name}
| Address | https://api.hanzo.ai/v1/functions/{name} |
| Method | GET |
| Operation | get_functions_by_name |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Is one function with everything a detail page needs in one round-trip: its definition, its 7-day rollup, its trigger, its twenty most recent invocations and the NAMES of the secrets it mounts.
Secret values are never read or returned. A name the caller's org does not hold is 404, which is also what another tenant's function looks like from here.
Request
1 field.
| Field | In | Type | Required | Description |
|---|---|---|---|---|
name | path | string | yes | Name is the function the URL names. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | functionDetail | ok |
200 body — 31 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
avgDurationMs | body | number | — | |
createdAt | body | string | — | |
endpoint | body | string | — | |
envCount | body | integer | — | |
environment | body | string | — | |
errors7d | body | integer | — | |
image | body | string | — | |
invocations7d | body | integer | — | |
lastDeployedAt | body | string | — | |
memoryLimit | body | string | — | |
name | body | string | — | |
namespace | body | string | — | |
recentInvocations | body | invocationView[] | — | RecentInvocations is its twenty most recent runs, newest first. |
recentInvocations[].durationMs | body | integer | — | how long it took |
recentInvocations[].id | body | string | — | the invocation's handle |
recentInvocations[].method | body | string | — | the HTTP method that triggered it |
recentInvocations[].status | body | string | — | how the run ended: ok, error or timeout |
recentInvocations[].statusCode | body | integer | — | Code is the status the function's OWN code answered with, which is not the status of the reply — a program can answer 500 through a healthy sandbox. |
recentInvocations[].time | body | string | — | when it ran, RFC3339 |
secrets | body | string[] | — | Secrets are the NAMES it mounts. |
status | body | string | — | |
successRate | body | number | — | |
target | body | string | — | |
timeoutSec | body | integer | — | |
triggers | body | triggerView[] | — | Triggers is how this function is reached. |
triggers[].enabled | body | boolean | — | whether it currently fires |
triggers[].functionName | body | string | — | the function it calls |
triggers[].id | body | string | — | the trigger's handle |
triggers[].name | body | string | — | a human label for it |
triggers[].target | body | string | — | the path it calls |
triggers[].type | body | string | — | what kind of trigger it is; HTTP is the only one today |
Failure carries the platform error shape — see Errors.
Examples
hanzo functions get <name>import { Configuration, FunctionsApi } from 'hanzoai';
const api = new FunctionsApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getFunctionsByName({ name: 'name' });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import FunctionsApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = FunctionsApi(client).get_functions_by_name(name='name')cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.FunctionsAPI.GetFunctionsByName(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, functions_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = functions_api::get_functions_by_name(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.FunctionsApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new FunctionsApi(client).getFunctionsByName();curl https://api.hanzo.ai/v1/functions/<name> \
-H "Authorization: Bearer $HANZO_API_KEY"The door reaches functions through the functions tool, which names its 10 operations with its own verbs — this one among them, under a name only the door declares. describe explains any of them:
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe",
"arguments": {
"op": "list_functions"
}
}
}'How is this guide?