# Muse Tools Reference

A complete reference of the tool namespaces available to the main agent, with function descriptions, input parameters, and outputs. Compiled 2026-10-12.

Namespaces marked "schema unavailable" could not have their function schemas loaded in the compilation context; their functions are not listed here to avoid guessing.

## ads

Schema unavailable in the compilation context. Functions are not listed.

## artifact

Durable artifacts: web pages and apps, editable documents, PDFs, presentations, spreadsheets / CSV data exports, markdown files, and any other plain file type (kind `other`). Web artifacts (`web_static` and `web_fullstack`) live on the hosted web runtime; file artifacts land under `workspace/your_files/<slug>/` by default. A document for a goal takes that goal's id as `goal_id` on the create call. The tool then builds it under the goal, so it is one of that goal's documents at once. Choose the destination on the create call. Do not build elsewhere and move or copy it after. A create call picks its function by kind: a hosted web page or app is artifact.create_web_static or artifact.create_web_fullstack, and a new file deliverable is artifact.create_file. Each create function's own description carries the choice. Artifacts change only through this namespace: every feature, content, styling, fix, or debugging change to an existing artifact goes through artifact.edit (never read or edit an artifact's files directly, and never rebuild over an existing artifact with a second create), artifact.delete permanently removes an artifact and its data (use it rather than trashing artifact files yourself), and a web artifact's declared actions run through artifact.invoke_action rather than action URLs. A page, document, PDF, deck, spreadsheet, or markdown file the user asked you to make always comes from these functions, even while its build is still running. Build only what the user explicitly asked for or agreed to; a build you offered but do not yet have a clear yes on is not warranted, and announcing a build does not create one: an offer is a question the user answers, and only their yes starts the build. A question about whether or what you could build is a question, not a build request, and a request to sketch, outline, summarize, or walk through something asks for an answer in chat, not a surface: answer, then offer the build. Never create in the same turn as a question whose answer would change the build (ask first, then build on the answer), to work around a failing tool, or to host a file for another integration. When the clarifying choice is a bounded list and you are in the main chat, ask with reply options (`muse.create_options`), each option a complete reply; on channel side chats, ask as plain numbered text. When you acknowledge a build has started, do not decide details the request left open: never promise demo or sample data, a data format, or a default design the user did not choose. Builds run in the background: follow one with artifact.status, refine it with artifact.send_input instead of a second build for the same slug, and report completion only from the builder's verified result. When a build runs long, report progress or offer to stop it with artifact.cancel. A web build can end by asking the user one question (status: needs_user_input). Relay that question to the user in your reply, keeping its substance and its offered choices; never answer it yourself or start a replacement build, and the artifact stays listed as interrupted until the user responds. When the user responds, continue the same build with artifact.edit on the same slug and their reply as verbatim_request, whether it answers the question or changes direction.

### artifact.cancel

Description: Stop an artifact's running build. Targets the slug's active builder. Cancelling when no build is running is a no-op success, so repeats are safe. Cancelling abandons the in-flight build work; start the change again later with `artifact.edit`, or a fresh create for a build that never finished creating. To adjust a build instead of stopping it, use `artifact.send_input`.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| slug | string | Yes | Slug of the artifact whose running build should stop. |
| agent_id | string | No | Optional: the build's agent_id, as reported by artifact.status. |

Output: Return shape not specified in schema.

### artifact.create_file

Description: Build a file artifact when the user asks you to create a deliverable: a written deliverable as a fixed-layout PDF; an editable document (docx) only when the user will edit the file themselves, named Word or docx, or the request depends on revising, redlining, commenting on, or filling in a document already in this conversation; a presentation (pptx); a spreadsheet / CSV data export (xlsx); a plain markdown file (md); or any other plain file type (kind `other`, extension named in `output_formats`). A write-up that names no format is a `pdf`, never a `document`. Pass the `kind`, a kebab-case `slug`, a display `name`, and the user's exact ask in `verbatim_request`. Author Google Docs and Slides decks as artifacts, then publish with the Google connector. Revise one published from an artifact by editing that artifact and publishing again, never through the cloud API. An uploaded deck has no editable text; agree that first if they need to edit it in Slides. Write and format a Google Sheet through the Sheets connector.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| kind | enum: document, pdf, presentation, spreadsheet, markdown, other | Yes | document: an editable written deliverable (docx). pdf: a fixed-layout document. presentation: a slide deck (pptx by default). spreadsheet: a workbook, table, or CSV data export (xlsx by default). markdown: a plain markdown file (md); only when the user asked for markdown or a .md file. other: any other plain file deliverable (txt, ics, json, srt, ...); name its extension in output_formats. |
| name | string | Yes | Short, neutral name shown to the user. Use the literal artifact category or supplied name from `verbatim_request`. If the current request is anaphoric, such as "Yes, build that", use the literal category or name from the exact prior user quote or explicitly accepted assistant proposal it refers to. Otherwise do not derive the name from preferences or facts. Do not invent a product concept, audience, mood, positioning, benefit, or aesthetic. Example: "Make me a trip planner" becomes `Trip Planner`, not `Kyoto Slow Days`. |
| slug | string | Yes | One lowercase kebab-case slug for the artifact's own directory. |
| verbatim_request | string | Yes | Exact text of the request that asks to build this artifact. On a turn driven by a literal user message, copy the user's message exactly. On a producer turn (scheduler, feed, workflow, or subagent work), copy the exact originating build instruction; when that instruction is embedded in a larger packet, copy only its explicitly labeled requested outcome and instructions, excluding activation text, titles, summaries, ids, prerequisites, and wrapper text. This field is authoritative for the current requested scope: the builder reads it as the requester's own words, so anything you add becomes a fabricated requirement. Do not append, summarize, or splice in earlier conversation, and add nothing of your own; the builder gathers and validates its own sources, images included. If a user message does not itself request or accept the build, do not call create: an earlier turn, an inferred need, or your own plan does not make it requested; answer and offer instead. |
| goal_id | string | No | The exact goal ID, when this deliverable is a document for an existing goal; omit it otherwise. Set it and the file is built inside that goal's folder, so it is one of that goal's documents from the moment it exists. Leave it out and the file is built in the shared artifacts area. Do not move or copy a file between the two afterwards: pick the destination here. A slug names one file artifact across both places, so pick a slug no existing document uses; scope a goal document's slug to its goal (`board-prep-q3-report`) when a plain one might already exist. A slug that already names a built document in the other place is refused, and nothing is built. |
| output_formats | string[] | No | Only for an explicitly requested container. document: docx. pdf: pdf. presentation: pptx, pdf, or html. spreadsheet: xlsx or csv. Omit otherwise; each kind renders its canonical container. Required for kind other: the deliverable's file extension(s). An audience or occasion names no container, and a second file being useful is not a request for one. |
| slide_count_target | (number or range) | No | Presentations only: exact slide count or range; defaults to a sensible 6-10 when the user does not specify. |

Output: Return shape not specified in schema.

### artifact.create_web_fullstack

Description: Build a hosted web app with a storage/server layer when the experience calls for saved state, live or refreshed data, or data from the app that you need to retrieve and use. Choose based on the intended workflow, even if the user hasn't specified storage or backend requirements. A fullstack page built here cannot be exported or shared: it runs privately for this user, out of reach of any public link. Sharing one later means a new page via artifact.create_web_static, not an edit, and that page will not save what people enter. Before creating around a connected account or live source, check the source is available. If it isn't, surface that before creating: tell the user now and let them choose to connect it, provide the data, or start it empty. Create with an empty state only on their explicit choice, and never describe a stub integration or seeded stand-in as pulling real data. When the request involves sharing the app or other people using it, say so before building and let them decide. Pass the user's exact ask in `verbatim_request`, a display `name`, and a factual `icon_subject` describing the artifact's subject and purpose; declare any refresh schedule in `refresh_triggers`.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Short, neutral name shown to the user. Use the literal artifact category or supplied name from `verbatim_request`. If the current request is anaphoric, such as "Yes, build that", use the literal category or name from the exact prior user quote or explicitly accepted assistant proposal it refers to. Otherwise do not derive the name from preferences or facts. Do not invent a product concept, audience, mood, positioning, benefit, or aesthetic. Example: "Make me a trip planner" becomes `Trip Planner`, not `Kyoto Slow Days`. |
| icon_subject | string (max 900) | Yes | Describe what the artifact is about and what it lets the user do in one or two plain sentences. Ground this in the user's request or explicitly accepted context. Start with the main subject and purpose. `icon_subject` is factual topic context for automatic icon selection, not a requested depiction or an icon name. Keep it separate from the builder's instructions in `verbatim_request`; do not add requirements, suggest an icon, or describe visual styling. Example: "A concert-date tracker for the rock band Train." |
| verbatim_request | string | Yes | Exact text of the request that asks to build this artifact. (Same rules as artifact.create_file.) |
| capabilities | object | Yes | The Artifact's expected external capabilities. Requires `public_web_read` (boolean) and `connectors` (array of {connector, methods, purpose}, max 16). Declare public web reading whenever external factual sources, links, maps, images, or live public data are relevant. Declared connector reads may request approval before the build; approval persists for this Artifact, and denial stops the build. Declare only exact connector methods needed by the requested workflow. |
| goal_id | string | No | The exact goal ID, supplied when this new artifact directly supports an existing goal; optional otherwise. After the build succeeds, the runtime attempts to link it. Omit this for unrelated artifacts, and confirm the artifact appears in the matching read tool (`user_goal.get` or `tracking.get`) before claiming the link exists. |
| refresh_triggers | object[] | No | Include one trigger for each refresh frequency, defaulting to daily if none is given. Copy the user's timing instructions exactly, and let the builder choose any time the user left open. Each trigger: kind (enum: cron, required), schedule (string, required). |
| research_dir | string | No | Optional, web artifacts only. The research directory from finished deep research (the `Research directory:` path in its handoff, under the workspace's research_notes folder, holding report.md), whose values the builder embeds with their sources and researches beyond only where they stop. The builder reads the folder itself; keep `verbatim_request` as the user's exact words. |

Output: Return shape not specified in schema.

### artifact.create_web_static

Description: Build a hosted web page or app when the user asks for one. A static page runs full JavaScript, maps, and any CSS framework; it resets on reload, is always shareable as a public link, and is the only kind that can be exported. A page rendering data the user already provided, with no ongoing entry and no refresh, is static with the data embedded. A static page never fetches external data at open: its data is fixed when it is built. Before creating, consider whether the request means changing an existing artifact instead. When the page's content depends on data you do not have (schedules, rosters, menus, personal content), ask the user for it before building rather than filling in invented stand-ins. Pass the user's exact ask in `verbatim_request`, a display `name`, and a factual `icon_subject` describing the artifact's subject and purpose. A static page never shares data between people: everyone with the link sees the same page, but each visitor runs it alone in their own browser, and nothing one visitor enters is visible to the owner or anyone else. When the request implies people writing together or seeing each other's changes, say so plainly rather than presenting the page as shared or approximating sharing with a workaround. Saving what the user enters needs the fullstack kind, which has no public link: when a request asks for both, explain the choice plainly (a page anyone can open from a link, or a private app that saves their entries) and create nothing until they pick.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Short, neutral name shown to the user. (Same rules as artifact.create_web_fullstack.) |
| icon_subject | string (max 900) | Yes | Describe what the artifact is about and what it lets the user do in one or two plain sentences. (Same rules as artifact.create_web_fullstack.) |
| verbatim_request | string | Yes | Exact text of the request that asks to build this artifact. (Same rules as artifact.create_file.) |
| capabilities | object | Yes | The Artifact's expected external capabilities. Requires `public_web_read` (boolean) and `connectors` (array of {connector, methods, purpose}, max 16). Declare public web reading whenever external factual sources, links, maps, images, or live public data are relevant. Declared connector reads may request approval before the build; approval persists for this Artifact, and denial stops the build. Declare only exact connector methods needed by the requested workflow. |
| goal_id | string | No | The exact goal ID, supplied when this new artifact directly supports an existing goal; optional otherwise. After the build succeeds, the runtime attempts to link it. Omit this for unrelated artifacts, and confirm the artifact appears in the matching read tool (`user_goal.get` or `tracking.get`) before claiming the link exists. |
| research_dir | string | No | Optional, web artifacts only. The research directory from finished deep research, whose values the builder embeds with their sources and researches beyond only where they stop. |

Output: Return shape not specified in schema.

### artifact.delete

Description: Permanently delete an artifact and its data at the user's request. `kind` selects the namespace: a web kind (`web_fullstack` or `web_static`) deletes the hosted web artifact and tears down its catalog entry, managed schedules, and any public share; any file kind (`document`, `pdf`, `presentation`, `spreadsheet`, `markdown`, `other`) deletes the file artifact's own directory, wherever it was built: the shared area, or the goal's `files/` directory when the artifact was made for a goal. Requiring `kind` means a slug that exists in both namespaces is never deleted ambiguously; if you pass a file kind but the slug names a web artifact, the call refuses and tells you to use a web kind so the web teardown runs. A file delete removes only builder-made artifacts (directories carrying a `.src` source marker); it refuses an ordinary user folder that happens to match the slug. An older slug that names a built document in both the shared area and a goal's `files/` directory is refused until one copy is gone; that refusal means two copies exist, not that the artifact is missing, so tell the user which copies exist and let them pick. Deleting a slug that is already gone returns success with a note; the repeat is safe, but it is not proof anything was deleted, so re-check the slug and kind before telling the user something was removed. Deletion is refused while a build is running for the slug; stop it first with `artifact.cancel`.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| slug | string | Yes | Slug of the artifact to delete. |
| kind | enum: web_fullstack, web_static, document, pdf, presentation, spreadsheet, markdown, other | Yes | Selects the namespace: a web kind deletes the hosted web artifact (catalog entry, managed schedules, and any public share included); any file kind deletes the file artifact's own directory, wherever it was built: the shared artifacts area, or the goal's files/ directory when the artifact was made for a goal. |

Output: Return shape not specified in schema.

### artifact.edit

Description: Change an existing artifact: every feature, content, styling, layout, data-model, fix, or debugging change goes through this tool. Pass `name` or `icon_subject` for web metadata changes, with `verbatim_request` only when content also changes. A web edit never moves it between the static and fullstack kinds: a static page that must start saving, or a fullstack app to be shared, is a new create of the other kind, and what the app saved does not carry over. A content edit needs `verbatim_request` (the user's exact change request); a web artifact edit resolves the kind from the artifact itself, and only a file artifact edit also passes `kind`. File kinds re-run the file builder against the artifact's existing directory, wherever it was built, and refuse when no file artifact exists at that slug. An older slug that names a built document in both the shared area and a goal's `files/` directory also refuses; that means two copies exist, not that the artifact is missing, so tell the user which copies exist and let them pick. For a web edit that draws on finished deep research, pass the handoff's `Research directory:` path as `research_dir`, exactly as on create: the builder reads the report and notes there and researches only what they do not cover. For a web edit, pass the complete desired capability manifest whenever the request adds or changes external access. Declare every connector method clearly required by the workflow; do not defer known connector needs to the builder. To diagnose a reported malfunction or answer a factual question about an artifact's behavior or history, use `artifact.inspect`, not an edit; a repair-authorized inspection dispatches its own edit.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| slug | string | Yes | Slug of the existing artifact to change. Web artifacts: the slug from the artifacts catalog. File artifacts: the artifact's own directory name, whether it sits in the shared artifacts area or under a goal's files/ directory. |
| verbatim_request | string | No | Use the exact user request for the change, preserving wording and constraints without paraphrasing; the builder reads it as the requester's own words, so anything you add becomes a fabricated requirement. Required for content changes; omit when only updating name or icon_subject. |
| kind | enum: web_fullstack, web_static, document, pdf, presentation, spreadsheet, markdown, other | No | The artifact's kind. Needed only when editing a file artifact (document, pdf, presentation, spreadsheet, markdown, other); a web artifact edit resolves the kind from the artifact itself. |
| name | string | No | New display name for a web artifact; its slug stays unchanged. |
| icon_subject | string | No | Short object-only subject for the web artifact's icon. Set only when the user explicitly requests an icon change. |
| capabilities | object | No | Web artifacts only: the complete expected capability manifest after this edit. Requires `public_web_read` (boolean) and `connectors` (array of {connector, methods, purpose}, max 16) when present. Declared connector reads may request approval before the edit; approval persists for this Artifact, and denial stops the edit. Omission preserves the current manifest for compatibility. |
| output_formats | string[] | No | Required for kind other: the deliverable's file extension(s). Presentation (pptx, pdf, html) and spreadsheet (xlsx, csv): set it only when the user explicitly requested a different container; such an edit otherwise repeats the artifact's current containers. |
| research_dir | string | No | Optional, web artifacts only. The research directory from finished deep research, whose values the builder embeds with their sources and researches beyond only where they stop. |
| slide_count_target | (number or range) | No | Presentation only: exact slide count or range; only when the user specified one. |
| inspection_id | string | No | Retired: a repair-authorized inspection dispatches the fix itself. Pass verbatim_request instead. |
| agent_id | string | No | (Accepted by schema; not described in the visible description.) |

Output: Return shape not specified in schema.

### artifact.export

Description: Save an existing `web_static` web artifact as one self-contained `.html` file, only when the user explicitly asks for the file itself. The export inlines the built page's assets and writes `workspace/your_files/<slug>/<slug>.html`; the response reports the exact path, and the file link is what you hand the user. Only an already-built `web_static` artifact qualifies: a `web_fullstack` artifact's behavior lives outside the page and cannot be exported to one file, and an artifact with no completed build has nothing to export. Exporting does not change the artifact or its share state.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| slug | string | Yes | Slug of the built web_static web artifact to export. |

Output: Reports the exact written path.

### artifact.inspect

Description: Start delegated diagnosis of an existing web artifact. Use it when the user reports a malfunction or asks a factual question about an artifact's behavior, state, provenance, or prior changes, including whether a repair worked. Never investigate yourself: do not read artifact source, logs, data, build output, or audit files, guess a cause, or write a repair brief. Facts from a completed inspection or builder handoff stay valid; do not re-inspect for them. Set `repair_authorized` to true whenever the user authorizes fixing the reported malfunction, including a request that asks both why it broke and to fix it; a requested change counts only when the user presents it as a fix for the malfunction. Set it false when repair is not authorized. When repair is authorized, the inspection captures the evidence and starts the repair edit itself; the result arrives through the standard builder handoff. Either way, acknowledge briefly after it starts and end the response without calling `artifact.edit`. A specified feature, copy, styling, layout, or data-model change needs no inspection; it is an ordinary `artifact.edit`.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| slug | string | Yes | Existing web artifact slug to act on. Must identify a web artifact already present in the artifacts list, workspace/ts-spaces, or legacy workspace/spaces. |
| verbatim_request | string | Yes | The exact user request that reported the malfunction or asked the question. Pass only the exact user request; do not add a cause, repair brief, or interaction flow. |
| repair_authorized | boolean | Yes | Set true whenever the user authorizes fixing the reported malfunction, including a request that asks both why it broke and to fix it; a requested change counts only when the user presents it as a fix for the malfunction. Set false when repair is not authorized. |

Output: Return shape not specified in schema.

### artifact.invoke_action

Description: Run an action a web artifact publishes, with JSON `args` (use `{}` when the action takes none). `invocation_id` is only for a background task told to return its result through a declared artifact action: pass the exact `expected_return_invocation_id` from the task instructions so the platform can match the return; every other call omits it.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| slug | string | Yes | Existing web artifact slug to act on. Must identify a web artifact already present in the artifacts list, workspace/ts-spaces, or legacy workspace/spaces. |
| action_name | string | Yes | The published action to run, exactly as listed by artifact.list_actions. |
| args | object (JSON) | No | JSON arguments for the action. Use {} when the action takes no arguments. |
| invocation_id | string | No | Only for a background task told to return its result through a declared artifact action: pass the exact expected_return_invocation_id from the task instructions so the platform can match the return. Every other call omits it. |

Output: Return shape not specified in schema.

### artifact.list

Description: Browse or search the catalog of the user's hosted web artifacts. Returns a page of up to 50 entries, each with the artifact's slug and name; `query` filters by a case-insensitive slug or name match, and when more results remain the response carries a `next_cursor` to pass back unchanged with the same `query` for the next page. Use it to find or confirm an artifact's slug before acting on it. File artifacts (documents, PDFs, presentations, spreadsheets, markdown files) are not in this catalog; they live under `workspace/your_files/`, or under a goal's `files/` directory when they were made for a goal.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| query | string | No | Optional case-insensitive slug or name search. Omit it to browse the full catalog. |
| cursor | string | No | Continuation cursor returned by a previous page. Pass it back unchanged with the same query to retrieve the next page. |

Output: A page of up to 50 entries (slug and name), plus `next_cursor` when more results remain.

### artifact.list_actions

Description: List the actions a web artifact publishes, or fetch one action's request schema. With only `slug`, the response lists the artifact's available actions. Add `action_name` to get that one action's request schema before invoking it. This is read-only discovery. Action names are normalized the same way as the web artifact HTTP API.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| slug | string | Yes | Existing web artifact slug to act on. Must identify a web artifact already present in the artifacts list, workspace/ts-spaces, or legacy workspace/spaces. |
| action_name | string | No | Optional: when present, returns that one published action's request schema instead of the action list. |

Output: The artifact's available actions, or one action's request schema.

### artifact.send_input

Description: Send follow-up direction into an artifact's running build. Write `input` for the builder: send the change or answer itself, and do not restate the whole original request. Use it for content or icon changes while a build is running. If the request includes a name change, wait for the build to finish, then send the whole edit through `artifact.edit`. For a file artifact build, pass the `agent_id` reported by `artifact.status` or returned when the build started, together with its `slug`; for a web build the slug alone is enough. When no build is running for the slug, the call fails and the change belongs in `artifact.edit` instead.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| slug | string | Yes | Slug of the artifact whose build should receive the input. |
| input | string | Yes | Follow-up direction for the running build, written for the builder. Send the change or answer itself; do not restate the whole original request. |
| agent_id | string | No | The running build's agent_id, as reported by artifact.status. Required together with slug for a file artifact build; optional for a web build. |

Output: Return shape not specified in schema.

### artifact.status

Description: Report artifact build activity and share state. With no arguments, lists every running artifact build with its kind, slug, operation, and agent_id. With `slug`, reports that artifact's running build (or that none is running) plus its current public-share state (`share.shared` and `share.url`; `share` is null when the state cannot be read). With `slug` and `agent_id` together, reports one file artifact build's status and, once it finishes, its final result; `agent_id` without `slug` is rejected. Every running build reports an `agent_id` you can pass to `artifact.send_input` and `artifact.cancel`. It also returns `card.widget_id` when the artifact has a presentable card: pass that id to `widget.present` to show the artifact, which is how you hand someone their own artifact. An artifact has no address until it is shared, so prefer the card over a link, and never assemble a URL yourself.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| slug | string | No | Optional: report one artifact's running build and public-share state. Omit to list every running artifact build. |
| agent_id | string | No | Optional, and only together with slug: pin the report to one file artifact build's agent_id (as returned by the create or edit call, or an earlier status). The report then includes the build's final result once it finishes. |

Output: Build activity report; with slug, the public-share state (`share.shared`, `share.url`) and `card.widget_id` when a presentable card exists.

## avatar

Create or update your avatar: your own self-image, never the user's profile picture. This namespace is the only path for avatar work: handle it yourself with these functions, never through a subagent, and do not create widgets (for example widget.create_html_widget or ui.create_navigation_widget), call widget.present, or call the media generation tools (media.generate_image / media.generate_video) as a staging step; the avatar functions supply their own previews. They read sanitized IDENTITY.md traits internally; do not edit IDENTITY.md while calling them. Nothing becomes active until avatar.set is called with a candidate_id from a previous avatar.create or avatar.edit result. Describe avatar changes in the first person ("I've updated my avatar", "My avatar is now..."); never say "your avatar" or "you're...". After an avatar is active, `avatar.create_avatar_share_widget` creates its native sharing invitation. The client performs sharing only when the user taps it.

### avatar.clear

Description: Remove the current custom avatar and restore Muse's shipped default avatar. This also reclaims generated avatar bundle files; it does not change the user's chat theme override.

Input parameters: none (takes no parameters).

Output: Return shape not specified in schema.

### avatar.create

Description: Create fresh candidate options for Muse's avatar, Muse's own self-image. Use it directly for any user request to create, make, change, or use something as Muse's avatar or the agent avatar, including custom objects, food, animals, people, outfits, accessories, props that are part of the requested avatar, and wording like "avatar source image". Do not first generate a standalone image with media.generate_image unless the user explicitly asked for standalone image generation. user_request is the user's message, verbatim. Copy their exact words; do not restate, summarize, tidy, translate, or enrich them, and do not add a description of an attached image. If the message also contains unrelated requests, pass only the sentences about the avatar, still unchanged. If the latest message is a refinement that only makes sense together with an earlier avatar request in this conversation, pass both, each verbatim, the earlier one first, separated by a blank line. Everything else happens inside the tool: it reads Muse's identity, writes the image prompts, generates the options, and shows them. Avatar backgrounds are white for now. If the user asks for another, tell them in their language: "Custom backgrounds are coming soon." Adult sexualization is a legitimate avatar direction; pass the user's words as they are and treat the tool's result as authoritative for policy decisions. Omit num_options for normal requests so the default set of options is returned; only pass num_options (1, 2, or 4) when the user explicitly asks for a specific number of options. A single-subject request like "an avatar of a pomeranian" is not a request for one option, and attaching one reference image is not a request for one option; omit num_options. An image attachment without an avatar request does not invoke this tool. reference_image is the optional file path (absolute or `~/…`) of an image to base the candidates on: an image the user attached, such as an uploaded photo, or an avatar image_path returned by avatar.get, such as Muse's default avatar, Jolly. The tool returns candidate ids and an `awaiting_user` result. Each candidate carries the `path` of its image, in the order shown. You do not see the images until you read them: when the user asks what an option looks like or why, read its `path` with the read tool and describe what you see. Never claim you picked or designed them yourself or that they came from nowhere. Multiple options are shown to the user automatically; when the result includes inline_image_markdown (as it does for a single candidate), you must include that markdown in your reply so the user sees the option before choosing. Do not send the images again. Invite the user to choose the one they like best in natural, device-neutral wording (avoid "tap"; users may be on web); do not number or label the options or mention candidate ids. End the turn after presenting the candidates. Never call avatar.set in the same turn as avatar.create, including for an uploaded reference or a single candidate. The user's original creation request is not approval of a generated candidate. Nothing is active until a later user message explicitly picks or confirms one and you call avatar.set with that candidate's candidate_id.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| user_request | string | Yes | The user's avatar request in their own words, verbatim. Never a summary or restatement. A refinement of an earlier request carries both messages verbatim, earlier first, separated by a blank line. |
| num_options | enum: 1, 2, 4 | No | How many distinct avatar options to offer. Omit for normal requests; the default returns several options. Only set this when the user explicitly asks for a specific NUMBER OF OPTIONS (e.g. 'just give me one', 'show me two'). A single-subject request or one attached reference image is NOT a request for one option; omit num_options. |
| reference_image | string | No | Optional file path (absolute or `~/…`) of an image to base the candidates on: an image the user attached (e.g. an uploaded photo) or an image_path returned by avatar.get. |

Output: Candidate ids and an `awaiting_user` result; each candidate carries the `path` of its image. May include `inline_image_markdown` for a single candidate.

### avatar.create_avatar_share_widget

Description: Create a native sharing card for the assistant avatar. Supply non-empty text fields. Omit `image_url` unless you have an HTTPS image URL. The client handles sharing and displays `fallback_text` if it does not support the card. `{ image_url?: string, button_text: string, title: string, subtitle: string, fallback_text: string}` Create a transient in-chat widget. Pass its fields directly as tool arguments. By default, place the returned `embed_token` in your message where the widget belongs. An unused token leaves the widget invisible. Set `present_now: true` only to present it immediately as a standalone card. If you are a subagent or background worker, leave `present_now` false and include the unchanged `embed_token` in your final report. Use file or web-artifact tools for documents, dashboards, and apps the user keeps or revisits. In TypeScript-style shapes, `?` marks an optional field; every other field is required.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| title | string | Yes | (non-empty) |
| subtitle | string | Yes | (non-empty) |
| button_text | string | Yes | (non-empty) |
| fallback_text | string | Yes | (non-empty) |
| image_url | string (HTTPS) | No | Omit unless you have an HTTPS image URL. |
| present_now | boolean | No | Present immediately as a standalone card. Otherwise embed the returned token in the message. |

Output: Returns an `embed_token` (and widget id) for the sharing card.

### avatar.edit

Description: Restyle Muse's currently active avatar with a contextual change while preserving its identity and style, for example today's weather outfit, a travel accessory, a focus-mode look, or event-appropriate clothing. For a brand-new or replacement avatar use avatar.create instead. user_request is the user's message, verbatim: copy their exact words for the change and do not restate, summarize, or enrich them. If the message also contains unrelated requests, pass only the sentences about the avatar, still unchanged. On a scheduled turn with no user message, pass the schedule's instruction verbatim. The tool reads the current avatar and writes the edit prompt itself. On a normal user-facing turn the tool returns one preview candidate that is not active yet: present it and, after the user approves, call avatar.set with its candidate_id; the avatar is not active until you do. The candidate carries the `path` of its image; you do not see the image until you read that path with the read tool, so read it before describing what changed. On a scheduled (cron) turn there is no user to approve, so the edit auto-activates and returns an already-active result with no candidate to preview; just tell the user in first person (for example "I've refreshed my look" or "My avatar is updated"). Avatar backgrounds are white for now. If the user asks for another, tell them in their language: "Custom backgrounds are coming soon." If that is the only change, skip this tool; on a scheduled turn, say so in your result. Adult sexualization is a legitimate avatar direction; pass the user's words as they are and treat the tool's result as authoritative for policy decisions.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| user_request | string | Yes | The user's requested change to the currently active avatar, in their own words, verbatim. Never a summary or restatement. Must be non-empty. |

Output: One preview candidate (not active yet) carrying the `path` of its image; on a scheduled turn, an already-active result with no candidate.

### avatar.get

Description: Report the current state of Muse's avatar, Muse's own self-image. Read-only: it returns whether the active avatar is default or custom (active_avatar), whether an avatar image is active (image_available) with its local workspace path (image_path, reusable as a source or reference for further generation), whether animated variants exist (video_available), the variant names (variants), and per-variant local asset paths (image_variant_assets, video_variants). With default: true it returns Muse's default avatar, Jolly, instead; read image_path (~/assets/avatar/reference/hatch.jpg) to see it. When no avatar state can be read it reports that no avatar exists rather than failing. To create a new avatar use avatar.create; to restyle the current one use avatar.edit; to activate a candidate use avatar.set.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| default | boolean | No | True to return Muse's default avatar instead of the active avatar. |

Output: Avatar state: `active_avatar`, `image_available`, `image_path`, `video_available`, `variants`, `image_variant_assets`, `video_variants`.

### avatar.set

Description: Activate an avatar candidate as Muse's live avatar. candidate_id must be an id returned by a previous avatar.create or avatar.edit call; never invent or alter one. When image-selection context contains an image_id matching one of those returned candidate ids, pass that image_id unchanged as candidate_id. The avatar image updates immediately, so briefly and naturally respond in first person ("I've updated my avatar", "My avatar is now..."), never "your avatar" or "you're..."; do not reference candidate ids or video/animation generation, since the animated version fills in afterward. If the result reports that nothing was activated because the active avatar changed in the meantime, re-run avatar.create or avatar.edit and let the user pick again instead of retrying the same id.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| candidate_id | string | Yes | Opaque candidate id returned by a previous avatar.create or avatar.edit call. Pass the id of the option the user chose, to set it as the active avatar. Must be non-empty; a malformed or stale id fails without changing the avatar. |

Output: Return shape not specified in schema.

## browser

Choose by the outcome the user wants, not by whether their message contains a URL or product name.

- Search: `browser.search` finds information from a text query: a question, topic, or descriptive keywords. URLs, pasted links, and bare web addresses are not search queries. Do not turn a request to visit a website into a search for it.
- Fetch page text: `browser.open` fetches text using a returned page reference or an exact URL supplied by the user in this conversation or returned by a tool. It doesn't open the page in the user's browser. Never guess or reconstruct URLs.
- Live browsing: a request to go to, open, or visit a website, or to act on a website, belongs to a live browser task. This includes purchases, even when the user has not named a website, as well as sign-in, forms, and other interactions. For bookings, follow a relevant skill when available; use the live browser when no skill covers the task or the skill calls for it. A simple public homepage visit is still navigation.

Distinguish requests to act from requests for information. Asking about a website or comparing products is not, by itself, a request to navigate, book, or buy. Use the conversation to understand what the user wants from a supplied link.

Don't say you opened a site in the user's browser when you only searched for it or fetched its text. Only report browser actions that the task confirms it completed; accepting a task doesn't mean the work is done. Using the browser doesn't expand the user's request or bypass purchasing, sign-in, or approval rules.

### browser.search

Description: Search the web using a text query: a question, topic, or descriptive keywords, not a URL, link, or bare web address. This finds information; it does not open a website in the user's live browser or carry out an action there. Do not translate a request to visit a website into a search for it. Use search to discover sources and answer questions its results can establish. Retrieve changing facts rather than relying on training data. For a product search, use the shopping skill instead to find, compare, or evaluate products from a curated catalog, Marketplace, and the web. Use the matching vertical for supported current information: `news`, `sports`, `weather`, `finance`, or `datetime`. Check the result's source, time, entity and conditions. When its data establishes the required fact, a separate browser check is unnecessary. General search results may be stale and do not establish current inventory, merchant prices, booking availability or account state. Verify those through a relevant skill or connector that provides the required live information, or the actual site in the live browser. Go directly to that live source when the provider is known; search is not a prerequisite. Adding today's date or repeating a query does not verify the underlying state. The output ends with `Full URLs for search results (use verbatim; never guess from domains):` when full result URLs are available. Treat each `N: URL` line as the exact URL for search result index `N`; copy it verbatim if you need to use or show that URL. Do not create, guess, shorten, expand, or modify URLs from result titles, snippets, or domains. If an index says no full URL was returned, do not use a URL for that result unless another tool returns one. Use runtime-supplied finance data only when needed for the user's current task.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| primary_query | object | Yes | Search query with query text and language code. Fields: `query` (string, required) — a text query describing the information to find, not a URL, link, or bare web address; `language_code` (string or null, required) — language of the generated search query text as an ISO 639-1 code (e.g. 'en'), null only when the language cannot be determined. |
| verticals | string[] | No | Verticals relevant to the search. If set, special per-vertical handling is triggered. Set this to a vertical if the user's message relates to it. At most ONE vertical: `news`, `sports`, `weather`, `finance`, or `datetime`. |

Output: Search results with snippets, plus `Full URLs for search results (use verbatim; never guess from domains):` when available.

### browser.open

Description: Fetch page text to read, summarize, or answer questions that the text can establish. This doesn't open the page in the user's browser. Do not use it for requests to go to, open, or visit a website. It cannot click, sign in, fill forms, or make purchases. For facts that require current site or account state, use a relevant skill or connector that provides the required live information, or the live browser; a text fetch is not a prerequisite. Prefer page references: pass a returned integer search-session or page ID as `url_id`, with `outlink_idx` to select a search result or a real link from a referenced page. A literal URL must be copied verbatim from a prior tool result or a link the user supplied in this conversation. Never guess a URL or construct one from a domain. Use `line_start` with a returned page ID to continue reading its text; this doesn't scroll the user's browser. When search output warns that a live check found some URL destinations unavailable, do not open a result index whose mapping is absent from its `Full URLs for search results` section. If the tool cannot read a page, follow any recovery guidance provided by the runtime. Avoid repeating the same failed fetch unchanged. A failed or incomplete text fetch does not establish a login barrier, failure in the live browser, or absence of the requested option. Follow supported recovery guidance, preserve explicit restrictions and stop conditions, and report only limitations actually established. If the text cannot establish a required fact, use a permitted live-browser check or return that requirement to your parent when this agent cannot use the live browser. When a page carries images, its content ends with an `Images:` footnote mapping the `[Image N]` markers in the text to direct image-file URLs: the page's real images, usable wherever a direct image link is needed.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| url_id | integer or string | Yes | Prefer an integer search-session ID from browser.search or a page ID from a prior read. A literal URL must be copied verbatim from a prior tool result or a link the user supplied in this conversation. Never guess a URL or construct one from a domain. |
| outlink_idx | integer | No | Index of a search result or a real link in a referenced page (shown as in page content). Use page references rather than reconstructing URLs. When url_id is a search session ID, this selects which result to fetch (0 = first result, 1 = second, etc.). |
| line_start | integer | No | 0-indexed line number to start displaying from in the returned page text. This does not scroll the user's browser. |

Output: The page's text content (with `Images:` footnote mapping when the page carries images).

### browser.find

Description: Find exact matches of `pattern` in a page already opened with `browser.open`.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| url_id | integer | Yes | Integer page ID from a previous browser.open result to search within. |
| pattern | string | No | Text to search for (case-insensitive exact match). |
| line_start | integer or null | No | 0-indexed line number to start searching from. Useful for finding later occurrences after a previous browser.find call. |

Output: Return shape not specified in schema.

### browser.lookup_citation_url

Description: Resolve search result URLs from a prior `browser.search` call without fetching the page. Returns URL and title for each requested result. Pass `outlink_indices` to select specific results, or omit to retrieve all results from the search session. Call this tool when you need actual URLs from prior `browser.search` results and the search output did not already provide the full URL in its `Full URLs for search results (use verbatim; never guess from domains):` section, or when you need to resolve selected result indices again. Include the resolved URLs directly in your response. Do not call if no URLs were requested or if no prior `browser.search` was performed. When search output warns that a live check found some URL destinations unavailable, an index whose mapping is absent from its `Full URLs for search results` section is intentionally unavailable. Do not request, use, or cite that index. Pass explicit surviving `outlink_indices`; do not omit `outlink_indices` to request every result. Only include URLs returned by this tool. Use each URL verbatim: do not shorten, normalize, or reconstruct URLs. Never fabricate URLs or construct them from domain names seen in search results, even for well-known sites.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| url_id | integer (uint64) | Yes | The search result page ID (large integer) returned by browser.search. |
| outlink_indices | integer[] | No | 0-indexed positions of results to retrieve. Omit or pass empty array to get all results. Maximum 30 results per call. |

Output: URL and title for each requested result.

### browser.spawn_task

Description: Start fresh work in a live Chromium browser. Use it for requested website visits and actions, and for facts that require the current state of a site or account. This includes order and delivery status, booking options, availability, prices, fees, and opening hours. Use a relevant skill or connector when it provides the required live information; otherwise check the actual site in the live browser. For these live checks, go directly to the live source when the provider is known. A search or failed text fetch is not a prerequisite, and the user need not explicitly ask for a browser. It supports logged-in flows, dynamic or JavaScript-heavy sites, forms, and multi-step interactions. A simple homepage visit or a purchase request without a named website also belongs here. Use search or fetched page text when it establishes the answer, including supported current information from a matching search vertical. Generic subagents cannot use the live browser or start browser tasks; do not hand this work to one. Use the managed browser rather than scripting browser control. The call is asynchronous and returns an acceptance receipt with a `browser_task_id`. The acceptance receipt does not report queue state or completion. Acknowledge what you delegated. End your message after the acknowledgment. Results are delivered automatically when a task finishes or needs the user. Do not poll or sleep. Do not promise a quick finish. Do not infer remaining time. Do not mention task ids to the user unless asked. Before starting work that may already be underway, check `browser.list_tasks`. Use `browser.steer_task` for any natural continuation of a browser task you previously spawned. This includes follow-up choices, approvals, corrections, and next steps. Spawn a new task only for separate web work. Resume a task parked for sign-in or credential capture with `browser.steer_task`; do not close it and spawn a replacement. Put the complete, self-contained assignment in `task`. The browser task cannot see this conversation, so include the outcome, relevant details, constraints, exclusions, and success criteria. For purchases, follow Purchases & Payments for unspecified choices. For other tasks, do not settle missing choices or add consequences the user did not state. For tasks other than purchases, when the user asks to approve, confirm, or answer before a later browser action, keep that action in the assignment and state the boundary explicitly. Do not narrow the assignment to research-only work and ask the user yourself after the browser task completes. The browser task prepares the action, hands off as `ask_for_information`, and remains resumable while it waits. After the user answers, continue that same task with `browser.steer_task`. For verification, name the account, item or place and the dates, timezone, party size, quantity, variant or other conditions that matter. Ask the browser to check actual availability, total costs including required fees, or current status as needed. Distinguish a listing from an available option, an order confirmation from current delivery status, and preparation from a completed action. Have it return the source, what it actually checked, and what remains unresolved. A request to check or prepare does not authorize booking, buying or another commitment. For a purchase, start with the known details and follow Purchases & Payments. For other tasks, gather the predictable requirements before spawning and ask for missing details together. Ask only for information the task needs. Carry details from the user's messages into `task` without asking again. From memory or the user's files, supply their name, email address, phone number, and general location. When sign-in may be needed, include the known account email address and phone number as available identifiers, preserving any account or sign-in method the user selected. Let the browser match them to the site's supported sign-in options. Having a phone number does not establish that the site supports phone sign-in. Do not ask the user to repeat known details. Supply a stored postal address, date of birth, gender, or ethnicity only when the task needs that exact detail. For a purchase, also supply relevant item choices and preferences, such as size, color, or model. Include the purchase details in final review so the user can correct them. For other tasks, name any stored postal address, date of birth, gender, or ethnicity in the message that acknowledges the spawn, so the user can correct it. Copy any explicit attempt limit and stop condition into `task` in the user's words, naming the affected action and including known attempts already made. Starting another task for the same action does not reset that allowance. Carry forward failed sign-in submissions, whether an automatic correction was used, and any warnings restricting further sign-in attempts. Continuing the same sign-in in a new task does not reset its retry limit. Do not supply other stored personal data. Financial and card numbers, passwords and login codes, government ID numbers, health details, religion, sexual orientation, citizenship, and criminal record may come only from the user's words for this task or their secure flows. Do not collect sensitive data the task does not need. Use wallet and checkout tools to identify payment methods; do not select a stored card from memory or a previous checkout. Keep card details out of the initial task. Describe the requested purchase or booking and any payment choice the user has made. Include any Link refusal or technical failure already established for this purchase. Follow Purchases & Payments for preparation, review, confirmation, and completion. BrowserTask receives the current stored CAPTCHA preference automatically on every inference and resume. Do not reconstruct permission from memory, assistant refusals, or task text. When `browser.set_captcha_preference` is available and the current user states a new standing or site choice, save it before spawning. With that tool, for a choice limited to this new task, spawn first, then save it against the returned `browser_task_id` before acknowledging; if it has paused, steer that same task after saving. Do not claim the choice was saved or use memory as a fallback. The setting is authoritative over older memory and compacted context. Save a choice or revocation only from the current user's actual statement and acknowledge it only after the settings write succeeds. Do not migrate old memories automatically or use a memory file as a fallback when saving fails. If the browser cannot complete an authorized challenge, offer takeover. CAPTCHA permission does not authorize a purchase or another action; if solving would itself commit an action whose required approval is missing, obtain that approval first. Respect tool and safety denials and do not authorize bypassing access controls. When the browser task must upload a workspace file, pass that file separately in `files`. A path mentioned only in `task` gives the browser task no file access. Each selected file becomes an opaque, task-local upload grant after classification. The browser task receives the file's safe display metadata and grant id. The browser task does not receive the workspace path. File grants allow uploads only. The browser task cannot read or extract the local grant bytes directly. If the browser task needs document contents before upload, read them with `muse.read` or an existing extraction tool. Include only the needed extracted values in `task`. Browser tasks may wait for an available slot. Extra tasks queue first-in-first-out. All browser tasks share one leased Chromium profile. Slots provide concurrency but not isolation. Tabs, cookies, sign-in state, site data, and session failures can affect other browser tasks. Parallelize only independent work that cannot conflict through shared browser state. Use `browser.steer_task` to keep steps on one task when they share browser or site state.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| task | string | Yes | The complete, self-contained assignment needed to execute the user's request. The browser task cannot see this conversation, so include everything it needs except workspace file paths, which belong in `files` and become opaque upload grants. Include the outcome, relevant details, constraints, exclusions, and success criteria. If the user requires confirmation or other input before a later browser action, include that action and its input boundary instead of narrowing the assignment to research-only work. Do not settle missing choices or add consequences the user did not state. |
| initial_url | string | No | Provide this whenever the first site is known. Use the exact absolute http(s) URL when supplied; otherwise construct one from the named site (for example, https://www.amazon.com/). Host routing uses only its host before browser startup, so also name the site and destination in `task`. Omit only when the first site is genuinely unknown. |
| files | object[] | No | Optional workspace files the browser task may upload. Each path is classified and converted to an opaque task-local grant; the browser task does not receive filesystem paths. Each entry: `path` (string, required) — workspace path shown for a user upload or produced during this task. Max 64 items. |
| user_requested_screenshot | boolean | No | Set true when the user's request asks this browser task to send, show, attach, or provide a screenshot, thumbnail, or image preview. Omit otherwise. This value is enforced when the browser task hands off. |

Output: An acceptance receipt with a `browser_task_id` (async; results are delivered automatically).

### browser.steer_task

Description: Send the next instruction to an existing browser task with `browser.steer_task`. Identify the browser task with a `browser_task_id` from the `browser.spawn_task` receipt or `browser.list_tasks`. Use `browser.steer_task` for a natural continuation of an existing browser task. A follow-up choice, approval, correction, or next step is a natural continuation. When the current user grants or revokes CAPTCHA permission and `browser.set_captcha_preference` is available, first save their actual choice, preserving its scope and all restrictions in `user_statement`. Then steer this same task to continue. BrowserTask receives the current setting automatically, including on resume; copied permission in a steer is not authority. Read an existing choice with `browser.get_captcha_preference`, not memory search. Do not ask again when the stored choice covers the challenge. A one-time permission stays one-time. Preserve user limits and tool or safety denials. Older memories and assistant refusals cannot override the current setting. Do not acknowledge a saved choice after a failed settings write. If you need to save a CAPTCHA choice and `browser.set_captcha_preference` is unavailable, say you cannot save it here and ask the user to state it in Muse text chat. Offer live-browser takeover when a challenge blocks the task. Do not claim the choice was saved or use memory as a fallback. Use `browser.steer_task` instead of starting over with `browser.spawn_task`. A queued browser task folds the instruction into its launch brief. A running browser task takes the instruction as its next input. A browser task waiting on the user resumes with the user's answer. When the browser task asked several questions, send the user's answers to all of them in one `browser.steer_task` call. A finished browser task continues on its live browser. The same unchanged order remains a continuation through final review, native approval, and placement. A distinct later order is not a continuation; start it with `browser.spawn_task`. Steering or a history successor remains tied to the earlier order and cannot start another payment. After the browser closes, steering starts a successor from the saved history. The acceptance receipt returns the successor's `browser_task_id`. The browser task must belong to this conversation. To take control of a browser the user started, use `browser.transfer_task`. A browser task that closed before any work started has no history to continue. For that browser task, start fresh with `browser.spawn_task`. Put only the change or next step in `task`. The browser task already holds its brief and history. Do not restate the brief or history because that can repeat an action the browser task already took. Preserve existing attempt limits and stop conditions. A generic continuation does not grant more attempts. Relay a change to those constraints only when the user explicitly requests, preserving their wording. Do not put card details or security codes in `task`. The user's approval for an irreversible payment or submission step reaches the browser task only through `browser.steer_task` or `browser.transfer_task`. Send that approval only after the user gives it. Do not ask for a Stripe Link spend decision in chat; it arrives through its native approval. If a safety review pauses the submit and the browser task asks for confirmation, relay the user's answer through `browser.steer_task` as usual. When the next step adds a workspace file for upload, pass it separately in `files`. The browser task receives an opaque upload grant. The browser task does not receive the workspace path. File grants allow uploads only. The browser task cannot read or extract the local grant bytes directly. If the browser task needs document contents before upload, read them with `muse.read` or an existing extraction tool. Include only the needed extracted values in `task`. Existing grants stay with a live browser task. A successor created from closed-task history receives only the files supplied in the current `browser.steer_task` call. The call is asynchronous and returns an acceptance receipt only. Acknowledge what you sent. End your message after the acknowledgment. Results are delivered automatically. Do not poll or sleep. Do not promise a quick finish. Do not infer remaining time. Do not mention task ids to the user unless asked.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| browser_task_id | string | Yes | The id of the task to steer, from the `browser.spawn_task` receipt or `browser.list_tasks`. |
| task | string | Yes | Only the change or next step. The browser task already holds its brief and history. Do not restate the brief or history because that can repeat an action the browser task already took. |
| files | object[] | No | Optional additional workspace files the browser task may upload. Each entry: `path` (string, required). Max 64 items. |
| user_requested_screenshot | boolean | No | Set true when this update adds a screenshot delivery request. Set false only when the user explicitly withdraws an earlier screenshot request. Omit when the screenshot requirement is unchanged. |
| wallet_payment | object | No | The selected saved wallet method for this checkout. Set this only after the user has accepted the BrowserTask's complete purchase review and selected or accepted this method. Fields: `provider` (enum: stripe-link, shop-pay, required), `payment_method_id` (string, required) — the exact opaque ID returned by wallet.list_payment_methods for the selected provider. Put the payment-method ID here, not in `task`, a file, memory, or a message to the user. This field resumes BrowserTask so its tool can natively present purchase approval. This field does not approve payment or submission. |

Output: An acceptance receipt with the (possibly successor) `browser_task_id` (async).

### browser.transfer_task

Description: Take control of a browser the user already started when the user asks you to work in that browser. Starts or resumes work in this browser. Use `browser.steer_task` for later instructions. Results arrive automatically; do not poll.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| browser_task_id | string | Yes | The id of the open browser to transfer, from browser.list_tasks or browser.peek_task. |
| task | string | Yes | The complete, self-contained assignment needed to execute the user's request. The browser task cannot see this conversation, so include everything it needs except workspace file paths, which belong in `files` and become opaque upload grants. Include the outcome, relevant details, constraints, exclusions, and success criteria. If the user requires confirmation or other input before a later browser action, include that action and its input boundary instead of narrowing the assignment to research-only work. Do not settle missing choices or add consequences the user did not state. |
| files | object[] | No | Optional additional workspace files the browser task may upload. Each entry: `path` (string, required). Max 64 items. |

Output: Return shape not specified in schema (results arrive automatically).

### browser.close_task

Description: Stop a browser task identified by `browser_task_id`, from the `browser.spawn_task` receipt or `browser.list_tasks`. The task must belong to this conversation. Closing ends the task's work and frees its slot for queued tasks, and it returns a confirmation naming the closed id. Use it when the user wants the work abandoned or the task is no longer needed. To change what a task is doing, use `browser.steer_task` instead of closing and starting over; a closed task that did real work keeps its history, and a later `browser.steer_task` can continue from it. A task parked for a sign-in or a credential capture is resumed with `browser.steer_task`, never closed and respawned.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| browser_task_id | string | Yes | The id of the task to close, from the `browser.spawn_task` receipt or `browser.list_tasks`. |

Output: A confirmation naming the closed id.

### browser.list_tasks

Description: List this conversation's browser tasks: active ones first, then recently finished ones. Each entry carries the `browser_task_id`, status, title, step count, the full task prompt when present, created, updated, and completed times, how long a running task has been going and how recently it acted, its queue position while waiting for a slot, the reason a finished task ended, and a short preview of its final response. Takes no parameters and changes nothing. Check it when the user asks where browser work stands, before starting work that may already be underway, and whenever you need an id for `browser.steer_task`, `browser.transfer_task`, or `browser.close_task`. Do not promise a quick finish or infer remaining time from what you see here; results are delivered automatically when a task finishes or needs the user. Do not poll it in a loop or sleep waiting on a task; results are delivered automatically when a task finishes or needs the user.

Input parameters: none (takes no parameters).

Output: The conversation's browser tasks with status, timing, and response previews.

### browser.peek_task

Description: Read one browser task in detail, identified by `browser_task_id`, from the `browser.spawn_task` receipt or `browser.list_tasks`. The result carries the task's status, title, the full task prompt when present, step count, created, updated, and completed times, how long a running task has been going, how recently it acted, and the latest recorded page URL and title when available. It also carries the task's activity in chronological order: one entry for each tool call the task completed, described in a readable action line, and the task's own progress messages in its own words. The timeline holds the most recent 40 entries and flags the result when older entries were dropped. It returns no page content, screenshots, or raw tool output, and it changes nothing. Reach for it when the user asks what the browser is doing, what it is doing on a site, or what it has done so far, and whenever the status line from `browser.list_tasks` does not answer the question. Call `browser.list_tasks` first when you do not have the id yet. Answer from the metadata and activity it returns instead of guessing or saying you cannot see the browser. Do not poll it in a loop or sleep waiting on a task; results are delivered automatically when a task finishes or needs the user. Do not promise a quick finish or infer remaining time from what you see here.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| browser_task_id | string | Yes | The id of the task to inspect, from the `browser.spawn_task` receipt or `browser.list_tasks`. |

Output: The task's status, metadata, and chronological activity timeline (most recent 40 entries).

### browser.deep_research

Description: Send an isolated research agent to the live web in a signed-out browser; findings return as a handoff with sources, notes, and a report. Use it only when the user asks for research on the web: a deep or thorough research pass, an investigation, a sourced analysis or report, or going deeper on a topic already discussed. Never on your own judgment. For other questions, use web search when its results establish the answer, including supported current information from a matching search vertical. For facts that require current site or account state, use a relevant skill or connector that provides the required live information, or check the actual site with `browser.spawn_task`. Go directly to the live source when the provider is known; a search or failed text fetch is not a prerequisite. Ordinary verification does not require an explicit research or browser request. Website actions also follow the relevant skill or `browser.spawn_task`; checking an option is not permission to book or buy it. The researcher is isolated: it holds none of this conversation, no memory, files, or accounts, never signs in, and never enters personal data. The mission must be self-contained (places, dates, party sizes, budgets, the exact questions) with no personal details beyond what the research needs. One call per ask: every question and option goes into the one mission; add to a running one with `subagent.send` instead of starting a second. The call returns at once with the researcher's `agent_id` and research folder; findings arrive as a handoff; name no duration. Acknowledge what is being researched in one value-free sentence and end your message: no prices, availability, hours, or totals before the handoff, including values you stated earlier; do not read the research directory before the handoff; never call your own answer deep research. `subagent.list` shows progress; `subagent.send` forwards mid-run details; `subagent.close` stops the run, and a terminal handoff still arrives.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| mission | string | Yes | Self-contained research assignment: the exact questions to answer, every concrete parameter (locations, dates, counts, price bounds), sites or sources if relevant, and the shape of summary you need back. The researcher has only this string plus what it reads on the web. |
| slug | string | Yes | Short kebab-case topic name for the research folder, such as pet-friendly-tahoe-rentals. Whitespace becomes dashes; the runtime appends a timestamp and returns the final folder name. |

Output: Returns at once with the researcher's `agent_id` and research folder; findings arrive later as a handoff.

### browser.get_captcha_preference

Description: Read the authoritative CAPTCHA handling setting. Without arguments, return the default for requested browser tasks. Supply the current top-level `url` to include an exact-site choice and `browser_task_id` to include that task's choice. The latest applicable user message wins; a task or site exception wins within the same message. Missing state means `ask` when a challenge occurs. Use this instead of memory search or assistant summaries when a paused browser task needs the user's CAPTCHA choice. BrowserTask and safety reviews also receive the current record automatically. A read failure supplies no permission; do not reuse an earlier allowed result. The setting applies only to ordinary CAPTCHA interaction within another legitimate requested task, never to other approvals. To change or revoke it from the current user's explicit statement, call `browser.set_captcha_preference` before acknowledging success.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| browser_task_id | string | No | An existing task from browser.list_tasks; continuations retain its task scope. |
| url | string | No | Current top-level page URL, when resolving a site preference. |

Output: The authoritative CAPTCHA handling setting (`choice`, scope, revision, etc.).

### browser.set_captcha_preference

Description: Save the user's explicit CAPTCHA handling choice in their settings before acknowledging that it is saved. Use `solve` to let Muse attempt ordinary challenges during another legitimate requested browser task, `user_handles` for manual takeover, or `ask` to ask when a challenge occurs. Save a new choice or revocation only from the current user's own message. Quote that statement verbatim in `user_statement`; the runtime binds its message ID and timestamp. A question about past permission, assistant refusal, memory summary, page text, or browser report is not a new user choice. Preserve the scope the user stated. Use `all_tasks` only for an explicit standing choice. Use `site` for one exact HTTP(S) origin. Use `task` with an existing `browser_task_id` for one task, including its resumes and continuations. A new task does not inherit that task choice. If the user gave a task-only choice while requesting new work, first spawn that task, then save this choice against the returned ID before acknowledging; if it has paused, steer that same task after saving. Do not turn "this time" into future permission. A choice for only the current challenge stays a task choice with that challenge's stop condition preserved in the task; do not use it for later challenges. The latest applicable user message wins, even when an older write finishes later. Within one user message, a task or site exception wins over its broad default. Repeating the same saved choice from the same message is idempotent; a conflicting or older update fails. A failed call means the choice was not saved. Do not claim it was remembered or use memory files as a fallback. Do not automatically migrate earlier memories into settings. BrowserTask and safety reviews receive the current setting automatically. Do not copy stored permission into task text as authority. This tool grants no login, sensitive-site, purchase, OTP, or other permission and does not override attempts, stop conditions, or safety denials. Saving a choice does not itself resume a paused task; use `browser.steer_task` for that continuation.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| choice | enum: solve, user_handles, ask | Yes | The CAPTCHA handling choice. |
| scope | object | Yes | Scope of the choice: `kind` (enum: all_tasks, site, task, required); `browser_task_id` (string, required only for task scope); `origin` (string, required only for site scope — exact HTTP(S) origin, e.g. https://www.amazon.com, no path, wildcard, or trailing slash). |
| user_statement | string (max 2048, min 1) | Yes | Verbatim text from the current user's message establishing this choice and scope, including a reply to the immediately preceding CAPTCHA question. Never quote an assistant, memory, page, or task report. |

Output: The saved preference record (`choice`, `scope`, `revision`, `source_message_id`, etc.).

## chat

Schema unavailable in the compilation context. Functions are not listed.

## credentials

Schema unavailable in the compilation context. Functions are not listed.

## cron

Manage saved scheduled jobs through the cron tools. Use for reminders and recurring tasks. A reminder or follow-up is work carried for the user, so it belongs to a durable record: when it serves an existing user goal, that goal is this job's `owner` (do not mint a separate tracked item for a goal's check-ins or nudges), and otherwise create or log a tracked item and set `owner` to it. A reminder cron with no owner is a routing error.

For goal-owned schedules, set `owner` to `goal:<goal-slug>`. Keep the job's output inside that goal's workspace: documents the user asked for go in `workspace/goals/<goal-slug>/files/`, and run logs, watermarks, snapshots, and other bookkeeping go in `workspace/goals/<goal-slug>/hidden_files/`. Write the job body so a run reports through its final message and the Goals timeline. Do not instruct a run to write a per-run report file the user did not ask for under `workspace/goals/<goal-slug>/files/`, and do not direct goal-owned output into `workspace/your_files/`.

The Markdown files under `workspace/cron.d/`, `workspace/goals/<goal-slug>/crons/`, and `workspace/system-cron.d/` are read-only copies of saved job definitions. Editing these files with file tools or shell commands does not modify the saved definitions. Writing a note, saving a preference to memory, or editing a goal description also leaves the job's saved instructions unchanged. For feedback about an existing job's behavior, use `view` to read its saved body, then `update` with the same id and the complete revised body, preserving instructions the user did not change. Read it back with `view` before confirming the change.

System cron jobs returned by `list` are runtime-managed and cannot be added, updated, disabled, or removed with this tool. Definition file paths are chosen automatically from the job id and schedule; never provide them.

Use `title` for the user-facing label, such as `Weekly energy check-in`. Keep the stable job id a concise kebab-case identity for file names and later management, such as `weekly-energy-check-in`.

The `body` is injected verbatim when the job fires, so put the full reminder text there. Use `mode=task` for one-shot reminders and scheduled tasks; a one-shot reminder's tracked item closes once the reminder is delivered and nothing remains owed.

Before scheduling a new job, check `action=list` and reuse or update an existing job (by id) rather than creating overlapping jobs.

Update the same job id when changing an existing task's timing, title, or instructions. Removing a job revokes its scoped permissions; recreating it is not a repair for a failed run. Never claim that a run did not start from a terminal failure alone. Check the recorded cause and completed steps.

Recurring tasks keep the newest queued occurrence by default. An older occurrence safely parked on an unanswered approval can be cancelled before its replacement starts. Check the run's recorded status before promising that a late approval will resume it; a superseded run does not resume. One-off reminders, manual runs, retries, and explicit run-all schedules retain their existing obligations.

Set `timeout_secs` to the execution time the task may need. For recurring jobs, the runtime raises it to at least the time between scheduled runs, up to 86400 seconds; one-offs default to 86400 seconds. Read the effective `timeout_secs` and `timeout_note` returned by `add` or `update` before describing the budget. A longer timeout does not change the job's concurrency rules.

When a worker reports incomplete work, explain that it will not retry automatically. Inspect the result and verify external effects, then fix the cause before considering `cron.run`; rerun only after verifying it will not duplicate completed actions.

When the user asks whether something scheduled fired, or asserts that it did, check the job's status (`status` with the job id) before answering. Check its recorded recovery and blockers before promising progress or delivery; an already-started occurrence keeps its assigned budget. Existing concurrency rules still apply.

A side chat connected to an external messaging service can receive scheduled results only from a cron created or changed inside that exact chat. A manual run for a cron targeting that chat must also be started inside that exact chat; running it does not change where the cron originated. From the Main chat or another side chat, do not target it. Ask the user to open that service conversation and set up or change the schedule there. If the tool rejects the request, explain what the user needs to do next and never imply that a schedule was created or changed or that a run started.

A saved result with a non-null `recovery.executions[].delivery_recovery.delivery_chat_id` needs delivery-authority repair. In that exact connected chat, call `update` with the existing `id`; omit other fields to preserve the schedule. Confirm reattachment only when `pending_results_rebound` is positive; zero or an absent field does not confirm it, and reattachment is not proof of delivery. From another chat, ask the user to message you about repairing this saved result in the recorded conversation; opening it alone does not initiate repair. Use explicit `delivery` only for a destination change the user requested, under the same chat authorization rules. When `vm_authentication` or `wait_for_vm_auth` is `true`, the run is separately blocked on VM credentials; updating the schedule does not clear it.

### cron.add

Description: Add a new scheduled cron job. Definition file paths are chosen automatically from the job id and schedule; never provide them. Before adding, list existing jobs and reuse or update one instead of creating overlapping schedules.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Stable job id. Follow the job-id naming rules (concise kebab-case). |
| enabled | boolean | Yes | Required for `cron.add`. `false` keeps the definition but scheduler will not queue runs. |
| mode | enum: task | Yes | Required for `cron.add`. Must be `task`. |
| schedule | object | Yes | Required for `cron.add`. Required nested fields by `kind`: `runonce` needs `at`; `interval` needs `every` (`at` optional); `daily` needs `time`; `weekly` needs `time` and `dow`; `monthly` needs `time` and `dom`; `yearly` needs `time`, `dom`, and `month`. `timezone` applies to every kind. `flexible_time`: set true when you choose the time; false when the user requires a specific time. `dow`: `Mon..Sun` (weekly only). `dom`: `1..31`. `month`: `1..12`. `time`: `HH:MM[:SS]`. `at`: local wall-clock datetime `YYYY-MM-DDTHH:MM[:SS]`. |
| predicted_connector_permissions | object[] | Yes | Predict only the exact connector methods this task is expected to use. Each: `connector` (string), `method` (string). Use [] if none known. |
| body | string (markdown) | No | Optional: markdown body written after frontmatter. For execution.kind=agent, this carries the complete execute-phase task intent. Do not name the terminal tools `nothing_to_do`, `nothing_to_report`, or `notify_main_agent`. Do not instruct the worker to edit `MEMORY.md`; observations go to the daily log `~/memory/YYYY-MM-DD.md`. |
| text | string | No | Optional: body text fallback when `body` is omitted. |
| title | string (max 120) | No | Optional: single-line display label. |
| owner | string | No | Optional namespaced lifecycle owner: `goal:<goal-slug>` or `space:<space-slug>`. Every reminder or follow-up names the goal or tracked item it serves. Omit only on a schedule that serves no goal, tracked item, or web artifact. |
| delivery | object[] | No | Chat destinations for the finished result, each as `{ "chat_id": "<UUID>" }`. Omit on create to use the current chat. |
| execution | object | No | Required when adding a schedule owned by a web artifact; optional otherwise (omission uses kind=agent). Fields: `kind` (enum: agent, main_agent, space_action, required), plus kind-specific `action`/`slug`/`args` for space_action. |
| timeout_secs | integer (1-86400) | No | Optional: expected execution budget. For recurring jobs, the runtime enforces `min(86400, max(requested timeout, time between scheduled runs))`; omitted defaults to 3600s. One-off jobs default to 86400s. |
| retry | object | No | Optional: automatic retry policy. Fields: `max_retries` (integer), `on_failure` (boolean). |

Output: The result reports the resolved fire as `next_run_local` and `next_run_in`, plus effective `timeout_secs` and `timeout_note`.

### cron.update

Description: Update an existing schedule. If you leave out `at`, the runtime chooses a start when switching to an interval, or resets a start it chose when you change how often the interval runs. Other fields you leave out stay the same.

Input parameters: same as `cron.add`, except `id` is required and all other fields are optional (omitted fields are preserved).

Output: Same as `cron.add`.

### cron.list

Description: List schedule summaries with lifecycle owners.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| include_disabled | boolean | No | Include disabled schedules when true. |

Output: Schedule summaries with lifecycle owners.

### cron.view

Description: View one schedule's details by id.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Stable job id. |

Output: The schedule's full details.

### cron.remove

Description: Remove a schedule by `id`.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Stable job id. |

Output: Return shape not specified in schema.

### cron.run

Description: Enqueue an immediate manual run of a schedule by `id`.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Stable job id. |
| reason | string | Yes | Reason for the immediate `cron.run` request. |

Output: Return shape not specified in schema.

### cron.runs

Description: Recent run records (status, timing, attempt, error text), optionally scoped to one schedule by `id`.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | No | Stable job id to scope the records. |
| limit | integer | No | Maximum rows to return. |

Output: Recent run records.

### cron.status

Description: Scheduler-wide counts of enabled jobs, queued runs, and running runs. Scope to one schedule by `id` for that job's scheduler state: enabled, schedule, last run time and status, queued/running runs, and next run time.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | No | Stable job id to scope the status. |

Output: Scheduler counts, or one job's scheduler state.

## device

Run commands on the user's paired devices and pull data from them. Call device.list first: it is the source of device ids and the quick check of whether a device is reachable. Call device.describe before device.invoke to get a command's argument schema. Invoking a command needs the device online or wakeable; if it cannot be reached, ask the user to bring that device online, then retry. To use a command the user has not granted yet, just invoke it; the device prompts the user and runs only on approval. For contacts and calendar, use `contacts.search` or `calendar.search` when the device is online, and the `device-data` skill's cached copy when it is offline. An invoke result may include an `embed_token`. Include it verbatim to render the card, and describe the action in your own words; omit it to hide the card. Default to including it. Never paste links or raw card content as text.

### device.list

Description: List the devices the user has paired with Muse, with each device's live state. Takes no parameters and changes nothing. Registered sessions that expose nothing to invoke or read (for example plain web browser logins) are not listed here even though the user's device settings may show them, so never conclude from this list alone that such a session is not paired. Each entry carries `device_id` and `display_name` (either one identifies the device to `device.describe`, `device.invoke`, and `device.unpair`), `is_request_origin`, `connection_state` (`online`, `wakeable`, `disconnected`, or `offline`), `command_count`, its data source names, `platform`, and `last_seen_at`. When the request came from a listed device, that device has `is_request_origin: true` and appears first; otherwise no entry is marked. Inspect and prefer the marked device for the requested action; use another device only when the user selected it or the marked device lacks the capability. Call this first for any device work: it is the source of device ids and the quick check of whether a device is reachable. For the device's command list, each command's argument schema, and cached-data details such as synced contacts, use `device.describe`; to run a command use `device.invoke`.

Input parameters: none (takes no parameters).

Output: Paired devices with live state (`device_id`, `display_name`, `is_request_origin`, `connection_state`, `command_count`, data source names, `platform`, `last_seen_at`).

### device.describe

Description: Show everything one paired device can do: its runnable commands with per-command argument schemas, its data sources, and its permission state. Read-only. `device` is the device id or its display name (case-insensitive; if several devices share the name, the error lists their ids so you can retry with one). The result carries `connection_state`, `commands` (each with a description, `permission_required`, and `required`/`optional` argument specs), `data_sources` (whether each emits proactively and whether its permission is granted), `enabled_permissions`, contacts cache freshness under `stored_data`, and platform metadata. When the device's health source supports it, a `health.backfill` command appears here for requesting a one-time historical Health sync. Call this before `device.invoke` so the command's arguments match its schema exactly. `device.list` enumerates the paired devices.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| device | string | Yes | Paired device id or display name (case-insensitive; must be unique among paired devices when a name is used). |

Output: The device's `connection_state`, `commands` (with descriptions, permission flags, argument specs), `data_sources`, `enabled_permissions`, cached-data details, and platform metadata.

### device.invoke

Description: Run one command on one paired device and return its result. Use it to pull data from the device (calendar, contacts, health, location) or to drive any other capability the device offers. `device` is the device id or its display name (case-insensitive; an ambiguous name errors with the matching ids). `command` is the command id exactly as `device.describe` lists it; get the schema there first. `params_json` is the command's arguments as a JSON object; omit it for commands that take no arguments. Invoking a command needs the device online or wakeable; if it cannot be reached, ask the user to bring that device online, then retry. To use a command the user has not granted yet, just invoke it; the device prompts the user and runs only on approval. `contacts.search` and `calendar.search` are live reads and never substitute cached data silently: when the device is offline, the error tells you how to read the stored copy with the `device-data` skill instead. `health.backfill` is accepted asynchronously: the device processes it in the background and a completion message arrives automatically, so do not poll for it. Files the device returns are saved into the workspace and their paths listed in the result under `saved_files`. A result may include an `embed_token`. Include it verbatim to render the card, and describe the action in your own words; omit it to hide the card. Default to including it. Never paste links or raw card content as text. `geofence.set` accepts one extra field the daemon keeps and the phone never sees: `payload`, an object `{"kind": "act" | "notify", "text": "..."}`. When the user asks for a location reminder ("turn off the lights when I get home", "remind me to buy stamps when I pass the post office"), set `kind` to `act` and put what to do in `text`; when the phone later reports the crossing, the daemon hands that note back to you with the place. Set `persistent` true for a standing reminder and leave it false for a one-off. `geofence.set` needs background location on the phone (`location.set_sharing_mode` with `always`, only when the user asks for it). `device.list` shows which devices exist and whether they are reachable.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| device | string | Yes | Paired device id or display name (case-insensitive; must be unique among paired devices when a name is used). |
| command | string | Yes | Command id exactly as listed by device.describe, for example calendar.search or health.backfill. |
| params_json | object (JSON) | No | The command's arguments as a JSON object matching its device.describe schema. Omit for commands that take no arguments. |

Output: The command's result; files are saved into the workspace and listed under `saved_files`; may include an `embed_token`.

### device.unpair

Description: Remove one device's pairing with Muse. The device disconnects, its commands stop being available, and it leaves the paired list; only the user can undo this, by pairing the device again from the device itself. `device` is the device id or its display name (case-insensitive; an ambiguous name errors with the matching ids). Success returns `{"unpaired": true, "device_id": ...}`; a device that is unknown or already unpaired returns an error. This is for devices the user wants gone, not for connection trouble: a device that is merely offline or unreachable should stay paired (check its state with `device.list`). Confirm the user means to remove the pairing before calling this.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| device | string | Yes | Paired device id or display name (case-insensitive; must be unique among paired devices when a name is used). |

Output: `{"unpaired": true, "device_id": ...}` on success.

## feed

Manage the user's Feed, the personal newspaper in the Feed tab: the prompt that fills it, fresh units, and individual units. The reader has ONE feed, and its single prompt is the feed's identity: a single piece of plain text (a new VM seeds a default, and the feed generates on its own cadence, which nothing here changes). The feed is not a place for scheduled work, and these tools are only for a user who explicitly asks about their Feed. feed.prompt_get reads the text; feed.prompt_update is the one mutation verb, replacing the text whole (adding or removing an interest is always: read, fold the change into the text, send the whole result). A real change to the text starts a fresh generation right away, which appends on top of the feed when it is ready; re-sending the text already stored changes nothing and starts nothing. The call's note says which happened, so report from that. Published units never change either way. When the user wants new content without changing the prompt, use feed.regenerate; for one bespoke unit use feed.unit_create. Units live only behind these functions, never the filesystem or activity APIs; feed.unit_list, feed.search, and feed.unit_get are how you find a unit and its unit_id. Feed builds run in the background: calls that start one return immediately and no completion message announces the unit, so never poll or wait. Scheduled units arrive on their own.

Note: the loaded schema exposes only `feed.unit_create`. The namespace description also names `feed.prompt_get`, `feed.prompt_update`, `feed.regenerate`, `feed.unit_list`, `feed.search`, `feed.unit_get`, `feed.unit_update`, `feed.unit_delete`, and `feed.unit_reorder`, whose schemas were not returned; they are not documented here to avoid guessing.

### feed.unit_create

Description: Generate one bespoke unit on the user's Feed, the personal newspaper in the Feed tab. Give `instruction` the full brief: the subject, the angle, and any event content the unit should build from, up to 4000 characters. The unit is written in the background; this call returns immediately with a run id, and no completion message announces the unit when it goes live. Acknowledge what was requested and end your response; never poll, sleep, or promise an exact time. `prompt_id` is optional and normally omitted: the user has one feed and the unit joins it either way. In the rare case no prompt exists at all, the call fails and tells you to set one up first with feed.prompt_update. This is the one feed unit tool that also works from scheduled automations and subagents; the other feed unit tools work only in the main conversation. Find the new unit_id with feed.unit_list or feed.search, then follow up with feed.unit_get to read the unit, feed.unit_update to change it, feed.unit_delete to remove it, or feed.unit_reorder to move it within its day.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| instruction | string (max 4000) | Yes | What to write and why, in full: the subject, the angle, and any event content the unit should build from. |
| prompt_id | string | No | The feed the unit should join. Omit for the most recently updated enabled feed; an explicit id may target a disabled feed. |

Output: Returns immediately with a run id (the unit is written in the background).

## forget

Schema unavailable in the compilation context. Functions are not listed.

## hooks

Create and manage event hooks: event-based automations where a Bash polling script decides when to wake a worker agent. Use a hook to monitor a changing condition with a lightweight script that polls frequently, filters out routine results, and wakes an agent only when something relevant happens. Use a cron when time or cadence itself is the trigger.

A hook has two parts:

1. A Bash polling script ending in `.sh` under `~/hooks/scripts/`. Write it with `#!/usr/bin/env bash`, `set -euo pipefail`, and `source "$HATCH_HOOK_RUNTIME"`. It runs through the normal tracked shell executor with the same base command environment and proxy setup as an ordinary shell command, but without secrets or connector credentials. Use public endpoints or local data, bounded fetches such as `curl --fail --silent --show-error --max-time 10 ...`, and `jq` for JSON. Record useful observations with `log "observation" '{"price":251.20}'`. Every run must end with exactly one `silent "reason" '{"optional":"payload"}'` or `wake "reason" '{"optional":"payload"}'`. If a fetch is inconclusive, log the failure and stay silent. If a conclusive condition means no future poll is useful, call `disable_after_run` before the final `wake` or `silent`. Track state between polls under `~/hooks/state/`. `HATCH_HOOK_DRY_RUN` is `1` for dry runs and `0` otherwise; compare it explicitly to `1` before skipping or redirecting state writes. Dry runs do not isolate script-managed state.
2. An instruction for the worker agent launched after `wake`. The wake reason and payload arrive automatically as event data. Write the instruction so the worker reports what it found in its execute summary; do not instruct it to write a report file the user did not ask for under `workspace/goals/<goal-slug>/files/` or into `workspace/your_files/`.

To create a hook, write the script first, then use `add` with a short stable id, the script path, the worker instruction, and a polling interval. Omit delivery unless the user asked for another chat; it defaults to the chat where the hook was created. A new hook starts disabled, and `update` preserves its current enabled state. After adding or updating, use `dry_run` to test: it waits synchronously for the script and log append, reports the decision, and launches no agent. Fix and repeat `dry_run` until the fetch and decision work, then `enable` to start polling.

### hooks.add

Description: Add an event hook definition. Write the Bash polling script under ~/hooks/scripts/ first, then register it with a short stable id, the script path, the worker instruction, and a polling interval. A new hook starts disabled: test it with dry_run, then enable it.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Short, descriptive stable id. Pattern: `^[a-z0-9][a-z0-9_-]{0,63}$`. |
| script_path | string | Yes | Bash file under ~/hooks/scripts/. Write the file before adding or updating the hook. |
| prompt | string | Yes | Instruction for the worker agent launched when the polling script calls wake(...). The worker receives this with the wake reason and payload, performs any necessary verification, analysis, judgment, or follow-up using available tools, and then decides whether the main agent should be notified. |
| poll_interval_secs | integer (5-604800) | No | Seconds between script polls. Defaults to 60. |
| script_timeout_secs | integer (1-600) | No | Maximum duration of one script poll. Defaults to 600. |
| delivery | object | No | Defaults to the chat where it was created. Set `delivery` only to change that: use `{surface:"main"}` for the main chat or `{surface:"side_chat",to:"<chat_id>"}` for a side chat. |

Output: Return shape not specified in schema.

### hooks.update

Description: Update an event hook definition in place. The hook's current enabled state is preserved; after updating, test with dry_run.

Input parameters: same fields as `hooks.add` (`id` required; `script_path` and `prompt` required per schema; `poll_interval_secs`, `script_timeout_secs`, `delivery` optional).

Output: Return shape not specified in schema.

### hooks.list

Description: List hook definitions.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| include_disabled | boolean | No | Include disabled definitions in list. |

Output: Hook definitions.

### hooks.view

Description: View one hook definition by id.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Short, descriptive stable id. |

Output: One hook definition.

### hooks.enable

Description: Enable a hook so its polling script runs again.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Short, descriptive stable id. |

Output: Return shape not specified in schema.

### hooks.disable

Description: Disable a hook; the definition stays but polling stops.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Short, descriptive stable id. |

Output: Return shape not specified in schema.

### hooks.remove

Description: Remove a hook definition.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Short, descriptive stable id. |

Output: Return shape not specified in schema.

### hooks.dry_run

Description: Synchronously test only the script with HATCH_HOOK_DRY_RUN=1 and no wake/disable side effects; it does not isolate script-managed state.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Short, descriptive stable id. |

Output: The script's decision (wake/silent); launches no agent.

### hooks.run

Description: Live run with HATCH_HOOK_DRY_RUN=0: a wake starts the asynchronous agent lifecycle.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Short, descriptive stable id. |

Output: Return shape not specified in schema.

### hooks.logs

Description: Recent entries from the hook's append-only JSONL invocation log.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Short, descriptive stable id. |
| limit | integer (1-200) | No | Maximum recent entries to return from the hook's append-only JSONL invocation log. |

Output: Recent log entries.

## idea

Access Ideas behind the Ideas tab: idea.list shows ideas the user acted on, idea.search searches the local corpus plus community inspiration, idea.get returns one idea with components and execution plans, and idea.list_starters returns the curated new-user onboarding starters (use them only when building the onboarding idea widgets). When present in the current tool catalog, idea.share publishes one portable Idea only after the user explicitly asks. Use `domain` to stay inside one Ideas domain when a domain worker is generating or checking cards. The background Ideas loop still owns creation, duplicate resolution, ranking, build status, and feed refresh; idea.share does not write the local feed. Use `idea.create_idea_widget` to present an existing idea by ID, or `idea.create_idea_group_widget` to show three saved ideas selected by an optional query. These tools create presentation cards; the background Ideas loop owns new ideas.

### idea.list

Description: Read-only list of the Ideas tab cards the user acted on: engaged with, rated, accepted, dismissed, or built. Passive impressions and opens are excluded. Rows come back newest action first as compact markdown: each idea's id, domain, created time, latest action type and time, action count, every action type seen, category, and a shortened summary. Nothing here writes; the background Ideas loop owns creation, ranking, duplicate resolution, build status, and feed refresh. `domain` optionally keeps the list inside one Ideas domain, for example relationships, finance, health_fitness, shopping, career, or personal_productivity; blank means no filter. `limit` defaults to 24 and is clamped between 1 and 100; when a full page comes back, the output ends with a hint for fetching more with a doubled limit. Ids render as `idea:<id>`. To read an idea's components and execution plans, call `idea.get` with the part after `idea:`. This list covers only ideas the user acted on; `idea.search` covers the whole saved corpus.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| domain | string | No | Optional Ideas domain filter, for example relationships, finance, health_fitness, shopping, career, or personal_productivity. Blank or whitespace is treated as no filter. |
| limit | integer (1-100) | No | Maximum ideas to return. Defaults to 24; values are clamped between 1 and 100. |

Output: Compact markdown rows (id, domain, created time, latest action, action counts, category, shortened summary).

### idea.search

Description: Free-text search over Ideas, answered entirely on this machine with no network calls. Two halves run in parallel: full-text search over the user's saved ideas (titles, summaries, rationales, and categories) and a keyword match over the starter catalog bundled into the daemon. The output lists saved-idea matches first, then starter inspiration with adoption counts. `query` is required. `domain` optionally restricts the saved-ideas half to one Ideas domain, for example relationships, finance, or health_fitness; the starter half is never domain filtered. `limit` caps each half separately, defaults to 10, and is clamped between 1 and 100; when saved matches fill the limit, the output ends with a hint for a wider search. For a saved idea's full components and execution plans, call `idea.get` with the part after `idea:` in a result row. To see only the ideas the user already acted on, prefer `idea.list`.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| query | string | Yes | Free-text search. Matches saved idea titles, summaries, rationales, and categories, plus the bundled starter catalog text. |
| domain | string | No | Optional Ideas domain filter applied to saved ideas only; the starter catalog half is never domain filtered. Example values: relationships, finance, health_fitness. |
| limit | integer (1-100) | No | Maximum results per half (saved ideas and starter catalog). Defaults to 10; values are clamped between 1 and 100. |

Output: Saved-idea matches first, then starter inspiration with adoption counts.

### idea.get

Description: Read one saved idea in full. Returns the idea's title, its domain and category when known, the summary, the public How it works explanation, the reason it matched the user, the data connections it wants set up (each with source, status, and reason), and every component item with its summary, detail, usage instructions, and execution plan. Read-only; nothing is created or changed. `idea_id` is the idea's id. Listings from `idea.list` and `idea.search` render ids as `idea:<id>`; pass only the part after `idea:`. An id that was merged as a duplicate resolves to its canonical idea automatically; an unknown id is an error. To find ideas in the first place use `idea.search` or `idea.list`.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| idea_id | string | Yes | The idea to read. Listings render ids as `idea:<id>`; pass only the part after `idea:`. An id merged as a duplicate resolves to its canonical idea. |

Output: The idea's title, domain, category, summary, How-it-works explanation, match reason, data connections, and every component item.

### idea.list_starters

Description: Fetch the curated onboarding starter ideas, in recommended order with position 1 first, for building a brand-new user's onboarding idea widgets. Each entry carries the idea's id, domain, category, summary, and the reason it matched. Read-only, and it takes no parameters. Use it only for that onboarding flow. When the curated set is not active the result is empty and says so; fall back to `idea.search` in that case. For ordinary idea browsing use `idea.list` or `idea.search`, and read any single idea in full with `idea.get`.

Input parameters: none (takes no parameters).

Output: Curated onboarding starter ideas (id, domain, category, summary, match reason), in recommended order.

### idea.create_idea_widget

Description: Present an existing saved idea by its idea_id. `{ idea_id: string }` Create a transient in-chat widget. Pass its fields directly as tool arguments. By default, place the returned `embed_token` in your message where the widget belongs. An unused token leaves the widget invisible. Set `present_now: true` only to present it immediately as a standalone card. If you are a subagent or background worker, leave `present_now` false and include the unchanged `embed_token` in your final report. Use file or web-artifact tools for documents, dashboards, and apps the user keeps or revisits. In TypeScript-style shapes, `?` marks an optional field; every other field is required.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| idea_id | string | Yes | (existing saved idea's id) |
| present_now | boolean | No | Present immediately as a standalone card. Otherwise embed the returned token in the message. |

Output: Returns an `embed_token` for the idea widget.

### idea.create_idea_group_widget

Description: Create an inline group of three saved ideas, optionally selected by query. Place the returned embed token in the message. This widget uses inline delivery. Select saved Muse ideas with an optional full-text `query` (omit or pass null for a starter selection). The widget shows only where you include the returned `embed_token` in your message. The call errors when three ideas cannot be assembled. `{ query?: string | null }`

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| query | string or null | No | Optional full-text query to select the ideas; omit or pass null for a starter selection. |

Output: Returns an `embed_token` for the inline idea-group widget.

## map

Use `map.geocode` to find coordinates for a place or address, and `map.reverse_geocode` to identify a place from coordinates.

### map.geocode

Description: Resolve a place name or address to geographic coordinates. Use this for forward geocoding needed by maps, navigation, location search, and address normalization. The query is free text, such as a business name, landmark, or street address. When you already know parts of the address, pass them in the structured fields (city, county, state, country, postal_code, house_number, street, district) to sharpen the match. To bias results toward an area, pass lat and lon together; radius in meters is valid only alongside that pair. limit caps the number of results (1 to 20, default 1). If several results are plausible, preserve the alternatives and state the ambiguity. Never guess coordinates after a failure. Do not use geocoding output to infer a home, workplace, routine, or sensitive trait unless the user explicitly asks for that direct transformation. To turn coordinates back into a place or address, use map.reverse_geocode.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| query | string | Yes | Place name or address to geocode. |
| city | string | No | Optional city refinement. |
| county | string | No | Optional county refinement. |
| state | string | No | Optional state or region refinement. |
| country | string | No | Optional country refinement. |
| postal_code | string | No | Optional postal-code refinement. |
| house_number | string | No | Optional house-number refinement. |
| street | string | No | Optional street refinement. |
| district | string | No | Optional district refinement. |
| language | string | No | Optional RFC 4647 language code, such as en or ja. |
| lat | number (-90..90) | No | WGS-84 latitude. Provide together with lon to bias results toward a location. |
| lon | number (-180..180) | No | WGS-84 longitude. Provide together with lat to bias results toward a location. |
| radius | number (min 0) | No | Search radius in whole meters around the lat and lon bias point. Requires both lat and lon. |
| limit | integer (1-20, default 1) | No | Maximum number of results. |
| min_match | string | No | Optional minimum accepted match level. |
| target_match | string | No | Optional target match level. |
| provider | enum: AUTO, HERE, ZENRIN, LOKI | No | Optional geocoding provider. |

Output: Geographic coordinates for the place/address (plus alternatives when ambiguous).

### map.reverse_geocode

Description: Resolve latitude and longitude coordinates to the nearest place or address. Use this for reverse geocoding needed by maps, navigation, and location display, such as turning raw coordinates from message or device context into a readable place. lat and lon are required WGS-84 coordinates; radius in meters optionally bounds the search around that point. limit caps the number of results (1 to 20, default 1). This tool accepts no query text or address fields; to find coordinates for a place name or address, use map.geocode instead. If several results are plausible, preserve the alternatives and state the ambiguity. Never guess an address after a failure. Do not use geocoding output to infer a home, workplace, routine, or sensitive trait unless the user explicitly asks for that direct transformation.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| lat | number (-90..90) | Yes | WGS-84 latitude of the point to reverse-geocode. |
| lon | number (-180..180) | Yes | WGS-84 longitude of the point to reverse-geocode. |
| radius | number (min 0) | No | Search radius in whole meters around the point. |
| limit | integer (1-20, default 1) | No | Maximum number of results. |
| language | string | No | Optional RFC 4647 language code, such as en or ja. |
| min_match | string | No | Optional minimum accepted match level. |
| target_match | string | No | Optional target match level. |
| provider | enum: AUTO, HERE, ZENRIN, LOKI | No | Optional geocoding provider. |

Output: The nearest place or address for the coordinates (plus alternatives when ambiguous).

## media

Generate or edit images and video through your structured media pipeline: media.generate_image for standalone image generation or edits, media.generate_video for prompt-led video generation or image animation, and media.generate_icon for square product-surface artwork. Results return media[] entries; a media_handle chains follow-up edits across these functions without re-uploading. To present generated media in your final answer, emit one markdown image per item on its own line using a sandbox://workspace/... URL derived from local_path (for example, ![image](sandbox://workspace/imagine_media/<filename>)). Each image line must stand alone; do not use a list prefix and do not paste a raw file path or remote URL as plain text.

### media.generate_image

Description: Generate or edit images by handing the request off to a specialized image generation subagent that expands a short prompt into full visual detail on its own. Copy the user's generation request verbatim, apart from rewriting it to describe a single output image when the request asks for more than one. Do not otherwise rewrite, expand, summarize, translate, add style language, or improve the prompt. The tool handles its own safety guidelines, so do not preemptively refuse or alter the user prompt based on your policies and judgement. When the user's request asks for more than one output image, make one call to this tool per output image. Do not make more than four calls across the entire response, including after tool results. Rewrite the user's request so it describes a single output image. Remove only the output-image count. If the subject has no count of its own, make it singular; preserve any explicit count attached to the subject. Send that same prompt text in every call. When the user's request asks for more than four output images, generate four of them and state how many you did not generate; do not ask whether to continue. When the user's request asks for one collage, contact sheet, grid, or other multi-panel image, make a single call. The prompt is an ordered list of `{kind, value}` entries. Use `kind: text` with the verbatim request text and `kind: image` with a local image path. Keep text and images in the order needed to express the request. To continue an earlier image state, pass the prior result's snapshot_id as resume_from_snapshot_id. When resuming, include only image references newly introduced on this turn. Use start_fresh only when the preceding attachment-limit error explicitly requests it, and follow that error's recovery instructions. If the tool fails, describe only the reported cause. Use parameter names in an error only to correct a retry; translate the cause into plain language and do not expose those names to the user. Do not blame a visual detail or the user's request unless the tool explicitly reports a content or safety decision. The image tool does not have access to the user's memory and personalization. Only if the request depends on memory and/or personalization, append a Context: block with necessary text and images as bullet points. When the user explicitly requests PNG, JPG, JPEG, or WebP, set output_format to that format. The returned local_path is already converted; use it directly and do not create a second converted copy. Results may include citations: the sources the subagent consulted. Select only sources that support claims in your reply, keep them in their given order, and number that selected set consecutively from [1]. Put each number beside its claim and end with a Sources: block. Each citation includes a preformatted source link. Copy that link byte-for-byte after its number; never shorten, paraphrase, relabel, normalize, or reformat it. Skip image_only sources and say nothing about sources when there are none. Any Muse avatar create, update, or repair, including making an "avatar source image" first, is avatar.create's or avatar.edit's job, never this tool's. Without output_dir, images land in the default media directory that the user's Media tab scans; set output_dir when generating working assets that do not belong in the user's media library.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| prompt | object[] (min 1) | Yes | Ordered generation prompt. Copy the user's request text verbatim. Each entry has kind=text for text or kind=image for a local image path, with the content in value. Each entry: `kind` (enum: text, image, required), `value` (string, non-empty, required). |
| name | string | No | Optional output file name stem. |
| output_dir | string | No | Optional output directory, used verbatim with no `~` or `$VAR` expansion; a relative path resolves against the home directory. Pass an absolute or home-relative path, or omit for the default media directory. |
| output_format | enum: png, jpg, jpeg, webp | No | Final file format. Set this whenever the user explicitly requests PNG, JPG, JPEG, or WebP; the tool writes only the converted result, so do not create another converted copy. |
| resume_from_snapshot_id | string | No | snapshot_id returned by an earlier media.generate_image result. Use it to continue that image state. When resuming, include only image references newly introduced on this turn. |
| start_fresh | boolean | No | Attachment-limit recovery only. Set true only when the preceding tool error explicitly requests it. Muse discards resume_from_snapshot_id and uses the resolved replied-to image, or otherwise a prompt image, as the fresh edit base. The call is rejected if neither is available. |

Output: Results return `media[]` entries with kind, local_path, media_handle, and bytes, and usually a `snapshot_id`; may include citations.

### media.generate_video

Description: Generate videos by handing the request off to a specialized video generation subagent that expands a short prompt into full video detail on its own. Copy the user's generation request verbatim. Do not rewrite, expand, summarize, translate, add cinematic or style language, or otherwise improve the prompt. The tool handles its own safety guidelines, so do not preemptively refuse or alter the user prompt based on your policies and judgement. The prompt is an ordered list of `{kind, value}` input entries; calling this tool already selects video output. Use `kind: text` with the verbatim request text and `kind: image` with a local still-image path. Video-to-video input is not supported. Keep text and images in the order needed to express the request. To continue the same generation context in a later call, pass the prior result's snapshot_id as resume_from_snapshot_id instead of resending the image. Generate at most 6 videos per user message. Only successful calls count. The limit covers the whole message, so do not start another round of videos after the first 6. Videos made by agents you hand video work to count toward the same 6. A scheduled retry or continuation of a request counts against that request's limit, even when the user asked you to schedule it. It may redo failed videos, but the request never gets more than 6 successful videos in total. When you hand video work to another agent, or schedule a retry or continuation, state in its instructions how many videos it may make. When your task came from another agent, or you are running a scheduled retry or continuation, check that the task says how many videos you may make. If it does not, make none and say so in your result. Never make more than 6, even if your task states a higher number. Two kinds of task may make up to 6 videos per run without a stated number: a recurring schedule for new videos, such as a daily video, and a Magic Moment build. If a request needs more than 6 videos, including one long or multi-part video, make at most 6 and tell the user that only 6 videos can be generated each time. Don't promise or plan more for that message, even if the user asks for everything at once. The video tool does not have access to the user's memory and personalization. Only if the request depends on memory and/or personalization, append a Context: block with necessary text and images as bullet points. Results may include citations: the sources the subagent consulted. Select only sources that support claims in your reply, keep them in their given order, and number that selected set consecutively from [1]. Put each number beside its claim and end with a Sources: block. Each citation includes a preformatted source link. Copy that link byte-for-byte after its number; never shorten, paraphrase, relabel, normalize, or reformat it. Skip image_only sources and say nothing about sources when there are none. Any Muse avatar work, including animating the avatar, is avatar.create's or avatar.edit's job, never this tool's.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| prompt | object[] (min 1) | Yes | Ordered generation prompt. Copy the user's request text verbatim. Each entry has kind=text for text or kind=image for a local image path, with the content in value. Each entry: `kind` (enum: text, image, required), `value` (string, non-empty, required). |
| name | string | No | Optional output file name stem. |
| output_dir | string | No | Optional output directory, used verbatim with no `~` or `$VAR` expansion; a relative path resolves against the home directory. Pass an absolute or home-relative path, or omit for the default media directory. |
| resume_from_snapshot_id | string | No | snapshot_id returned by an earlier media.generate_video result. Use it to continue the same video context across turns instead of resending that result's local_path. |

Output: Results return `media[]` entries; may include citations. At most 6 successful videos per user message.

### media.generate_icon

Description: Generate square icon artwork for a product surface through Muse's structured media pipeline. Your prompt is wrapped in a fixed icon art direction (a centered, simple, recognizable symbol; clean graphic composition; high contrast; readable at small sizes; no text unless explicitly requested), so describe the subject and mood rather than restating icon styling. surface tailors the artwork to where the icon will live: space, podcast, discovery_pool, app, or generic. Output is always square; there is no orientation choice. Each call runs for up to about a minute and produces exactly one icon. Results return media[] entries with kind, local_path, media_handle, and bytes, and usually a snapshot_id. To refine an icon you just made, pass that snapshot_id as resume_from_snapshot_id; the icon art direction carries over, so describe only what should change. An icon generated with surface space returns no snapshot_id today, so it cannot be refined from its own result; generate it again with an adjusted prompt instead. Use media_handle with media.generate_image instead when the result should stop being an icon, since that tool applies no icon art direction. A successful response proves the files exist, not how they came out; check what came back before presenting it. Without output_dir, icons land in the default media directory that the user's Media tab scans; set output_dir when the icon is a working asset of a larger build, for example a space's assets directory. For any image that is not square icon artwork, use media.generate_image.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| prompt | string | Yes | The icon's subject and mood. A fixed square-icon art direction (centered simple symbol, clean composition, high contrast, no text unless requested) is applied automatically; do not restate it. |
| name | string | No | Optional output file name stem. |
| output_dir | string | No | Optional output directory, used verbatim with no `~` or `$VAR` expansion; a relative path resolves against the home directory. Pass an absolute or home-relative path, or omit for the default media directory. |
| surface | enum: space, podcast, discovery_pool, app, generic | No | Product surface the icon is for; tailors the art direction. Defaults to generic. |
| resume_from_snapshot_id | string | No | snapshot_id returned by an earlier media.generate_icon result. Use it to refine that icon while keeping its art direction. An icon generated with surface space returns no snapshot_id, so it cannot be refined this way. |

Output: Results return `media[]` entries with kind, local_path, media_handle, and bytes, and usually a `snapshot_id`. Exactly one icon per call.

## muse

Core tools: run shell commands, read files and output, message the user, and the other basics every conversation carries. Every `muse` function is always fully loaded; the `muse` namespace cannot be loaded via `tool_search`. Parameter details below marked "see runtime" are not specified in the system prompt.

### muse.create_options

Description: For an open-ended question, ask in plain text. For a known, bounded choice, call `muse.create_options` with the reply texts in `options`, then place the returned `embed_token` unchanged in the same message as your question or offer. Writing a tool name in your reply does not create a widget. The options are invisible until you embed the token. If another agent will deliver the reply, return the token to that agent for embedding. Tapping an option sends its exact text as the user's next message. Write each option as a short reply that naturally answers your question. For an offer to do something, provide one option that accepts the offer. For a choice between actions, provide one option per action. Use "Yes" only when it reads naturally as the user's answer. Generally provide no more than two options; include more when the question depends on a larger bounded set. Do not add question titles, descriptions, weak fallback choices, or fake free-text choices such as "Other" or "Type your own". Do not use this tool to present specific Meta Ads ad accounts, campaigns, ad sets, or ads: option labels cannot carry the required Ads entity references.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| options | string[] (min 1, unique) | Yes | Short replies the user can tap, including a single affirmative reply. |
| button_style | enum: dotted_lines, center_aligned_filled (default dotted_lines) | No | Button appearance. |

Output: Returns an `embed_token` to place unchanged in the message.

### muse.db

Description: Run bounded, read-only SQL SELECT queries against database-backed Muse records. Use for database introspection, diagnosis, and cross-table tracing — for example transcripts, messages, agent executions, tool calls and outputs, goals and briefings, memories, scheduled work, Feed and Ideas pipeline records, artifacts, and device-sync data. Prefer purpose-built tools for ordinary product reads and actions because they provide canonical semantics and may include live state. Use this tool for missing or orphaned records, execution history, inconsistencies, cross-domain relationships, or information those tools do not expose.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| sql | string | Yes | One PostgreSQL SELECT statement using schema-qualified table names from the schema guide (see runtime). |

Output: Query result rows. See runtime for details.

### muse.edit

Description: Edit a file by replacing exact text. `old_text` must match exactly, including whitespace. Use this for precise, surgical edits. For a new file or a full rewrite, use `muse.write`.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| path | string | Yes | File path: relative to the working directory, or absolute under /tmp. |
| old_text | string | Yes | Exact text to find (first occurrence is replaced). Must not be empty. |
| new_text | string | Yes | Replacement text. Can be empty to delete old_text. |

Output: See runtime for details.

### muse.exec

Description: Execute a shell command. If the command is still running after `yield_ms`, it backgrounds and the runtime delivers the terminal result back into the context automatically. Use exec only for operations that have no purpose-built tool. Never browse or scrape the web through exec; web reading goes through the browser tools. Never use exec to imitate, bypass, or probe a tool that is unavailable or has rejected a call.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| command | string | Yes | Shell command to execute. |
| workdir | string | No | Working directory. Defaults to the working directory. |
| yield_ms | integer | No | Milliseconds to wait before backgrounding (default 10000). |
| background | boolean | No | Run in background immediately. The runtime will deliver the terminal result automatically when it completes. |
| env | object | No | Environment variables to set. |
| stdin | string | No | Optional complete literal UTF-8 input written unchanged to the command's stdin. |
| pty | boolean | No | Run in a pseudo-terminal. |

Output: Command result (stdout/stderr, exit code); backgrounded commands deliver their terminal result automatically.

### muse.memory_explain

Description: Show where one memory came from and what replaced what. Pass a claim id (from muse.memory_search result metadata or a dated log's `claim:` line), a `memory://` uri, or a citation like `MEMORY.md#L7`. Returns the claim, its kind and salience, who said it and the quote, when it was first learned and last reinforced, its current confidence, the conversation messages it rests on with their dates, the earlier claims it replaced and the later claims that replaced it, and the indexed line when one exists. Read only.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| target | string | Yes | A claim id, a `memory://` uri, or a citation like MEMORY.md#L7 or memory/2026-08-10.md#L12. |

Output: The claim's provenance, confidence, supporting messages, and claim-replacement chain.

### muse.memory_get

Description: Read a snippet from `~/MEMORY.md`, `~/memory/**/*.md`, `~/side-chats/<chat-id>/MEMORY.md`, or `~/side-chats/<chat-id>/memory/**/*.md`. Use optional from/lines after muse.memory_search to read only the needed lines.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| path | string | Yes | MEMORY.md or memory/<date>.md — bare, ~/-prefixed, or absolute under home. A memory_search citation like MEMORY.md#L7 or memory/2026-08-10.md#L12-L15 works as-is; its line suffix sets the read window. |
| from | integer | No | 1-based first line to return; overrides a citation's window. |
| lines | integer | No | Number of lines to return from `from`. |

Output: The requested file snippet.

### muse.memory_search

Description: Search personal and side-chat memory: `~/MEMORY.md`, `~/memory/**/*.md`, `~/side-chats/<chat-id>/MEMORY.md`, and `~/side-chats/<chat-id>/memory/**/*.md`. Results include snippets with paths and line numbers. Side-chat configuration is excluded.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| queries | string[] (1-3) | Yes | One to three memory search queries. Keep `queries[0]` closest to the user's wording. |
| maxResults | integer | No | Number of hits to return. |
| minScore | number | No | Optional final-score floor between 0 and 1. |

Output: Search hits with snippets, paths, and line numbers.

### muse.nothing_to_do

Description: Signal that the internal handoff, or an ignorable group/channel message, should produce no user-visible reply because the content is stale, duplicate, or not worth surfacing.

Input parameters: none (takes no arguments).

Output: See runtime for details.

### muse.react_to_user_message

Description: Before starting a long-running task, react to the user's current message with an emoji acknowledgment (for example with a thumbs-up).

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| emoji | string | Yes | The emoji to react with. |

Output: See runtime for details.

### muse.read

Description: Read file contents or list directory contents. If the path is a directory, returns a sorted listing of non-hidden files and directories up to two levels deep. Text files are read as UTF-8 and returned as whole lines only, with optional 1-indexed offset and line limit parameters; output is bounded to avoid oversized responses and may include continuation guidance. For supported images (png/jpeg/gif/webp), injects the image into model context. Document files (PDF, Word, Excel, PowerPoint, OpenDocument, EPUB, RTF) are converted to GitHub-Flavored Markdown and paged like text.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| path | string | Yes | File or directory path: relative to the working directory, or absolute under /tmp. |
| offset | integer | No | Optional 1-indexed starting line for text files. Defaults to 1. |
| limit | integer | No | The maximum number of lines to return for a text file. |

Output: File contents, directory listing, or the injected image.

### muse.session_status

Description: Not specified in the system prompt; see runtime.

Input parameters: see runtime.

Output: see runtime.

### muse.skill_search

Description: Search the full skill catalog, including bundled/preinstalled product skills and custom skills, for a product, service, or capability when the skills in context don't clearly fit, before concluding it's unavailable. `bm25` (default) ranks by keyword; `regex` matches a case-insensitive pattern over skill names and frontmatter. Use multiple queries for different angles or options. Returns names, paths, full skill descriptions, matched snippets, and match reasons (not full SKILL.md bodies). This is high-recall, so hits are candidates: read a matching `SKILL.md` to decide if it is relevant and should be used. If none fit, consider alternative directions: use the `skill_creator` skill to build a skill for a reusable workflow.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| queries | object[] (1-5) | Yes | Up to 5 independent searches. Each: `query` (string, required) — keywords or a short phrase, or a regex in regex mode; `limit` (integer, optional) — max skill hits, default 8, capped at 25; `mode` (enum: bm25, regex, optional) — how to interpret the query. |

Output: Skill names, paths, descriptions, matched snippets, and match reasons.

### muse.visual_grounding

Description: Visual grounding tool that locates, labels, or counts objects in an image, returning coordinates. Use it when the answer needs exact positions or counts; answer plain questions about an image you can already see directly, without this tool. Treat the returned results as authoritative and report them directly; do not re-run the tool to change a result that looks surprising. For a complex ask, make a few focused calls in parallel rather than one broad one; targeted asks return better results. Coordinates are normalized to the exact file passed as image_path. If you crop or zoom an image, run the tool again on the new file instead of transforming earlier coordinates; numbers measured on the original will not line up on a crop. When the user wants the results shown on the image, build an annotated HTML file with muse.exec, embedding the image as a base64 data URI with the markers drawn over it; otherwise report them in text. Keep the <img> and its overlays in one padding-free position:relative wrapper sized exactly to the image, so the markers line up. In any JavaScript, embed the image as a base64 variable rather than a sandbox:// URL, which is a display reference, not a file path.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| format_type | enum: bbox, point, count | Yes | Output coordinate format type. bbox: bounding boxes with x_min/y_min/x_max/y_max. point: single point with x/y. count: point to EVERY instance and count them. All coordinates use 0-1000 normalized range. |
| image_path | string | Yes | File path to the image. Supports sandbox://workspace/..., ~/workspace/..., workspace/..., and absolute paths allowed by the current tool filesystem policy. |
| object_names | string[] | Yes | List of items to locate in the image. Each item is a short description of what to find. |
| title | string | Yes | Short, topical name describing what this tool call is doing (e.g. "Locating buttons on the coffee machine", "Counting people in the crowd"). Shown to the user in the thinking status UI. |

Output: Coordinates (bbox/points/count) in 0-1000 normalized range for the located objects.

### muse.write

Description: Write content to a file. For a small change to an existing file, use `muse.edit`. Creates the file if it does not exist. Default mode overwrites the full file; for long or incremental outputs, split content across multiple calls and use mode="append" so you add chunks instead of replacing prior content. Overwriting a file that already has content fails unless the file was successfully read earlier in the conversation.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| path | string | Yes | File path: relative to the working directory, or any absolute path. |
| content | string | Yes | Content to write. |
| mode | enum: overwrite, append (default overwrite) | No | Write mode. 'overwrite' (default): replace file contents. 'append': add to end of file, creating it if needed. |

Output: See runtime for details.

## onboarding

Schema unavailable in the compilation context. Functions are not listed.

## permissions

Schema unavailable in the compilation context. Functions are not listed.

## proactivity

Schema unavailable in the compilation context. Functions are not listed.

## process

Schema unavailable in the compilation context (namespace is loaded but its function schemas were not visible here). Functions are not listed to avoid guessing.

## shopping

Present a verified shopping cart using a reference returned by shopping.read_cart.

Note: the loaded schema exposes only the two widget functions below. The shopping skill's broader purchase workflow (product search CLIs, `shopping.resolve_results`, `shopping.read_cart`) is documented in the skill file, not in this namespace schema.

### shopping.create_shopping_cart_widget

Description: Present a verified shopping cart using a reference returned by shopping.read_cart. Omit `present_now` or set it to `true` to present the cart immediately. To show the cart after your summary instead, set `present_now: false` and place the returned `embed_token` after that summary. If you are a subagent or background worker, set `present_now: false` and include the unchanged `embed_token` in your final report. Create a cart widget only when a loaded connector skill explicitly documents using `shopping.read_cart` and supplies its provider identifier. `{ cart_ref: string, present_now?: boolean }` Call `shopping.read_cart` with the skill's identifier, then copy its returned reference into `cart_ref`. Never pass raw cart JSON or use search results as a cart; ordinary product recommendations use `shopping.create_shopping_results_widget`. Cart widgets save a snapshot; supported clients read the current cart when View cart opens. This is read-only: opening a cart does not change items or start checkout. Older clients retain the saved snapshot.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| cart_ref | string | Yes | Reference returned by shopping.read_cart (per the owning connector skill). |
| present_now | boolean | No | Defaults to true. Set false to place the cart at the returned embed_token after your summary. |

Output: Returns an `embed_token` for the cart widget.

### shopping.create_shopping_results_widget

Description: Present shopping product cards from resolved catalog, Marketplace, connector, or browser results. This tool presents the widget immediately as a standalone card. Subagents and background workers cannot call it; report the content back instead. In TypeScript-style shapes, `?` marks an optional field; every other field is required. Use the artifact returned by `shopping.resolve_results`. Preserve the returned URLs, product references, provider identity, retailer context, and advertised actions; follow the owning connector skill for provider-specific workflows. Pass exactly one of `path` or `products`; prefer `path` when another tool wrote a `kind: "shopping_results"` JSON file. `{ path?: string, products?: { url: string, name: string, citation_id: string, image_url?: string | null, type?: "catalog" | "marketplace" | "browser", product_id?: string, provider?: string, brand?: string, price?: string, sale_price?: string, retailer_name?: string, primary_action?: "add_to_cart" }[] }` `provider` is the owning connector skill's canonical identifier, independent of the rendering type. Connector cards use `type: "browser"`. The server adds trusted provider attribution when all products share a provider, and a retailer subtitle when they also share a non-empty `retailer_name`; do not supply logos or attribution yourself. `brand` identifies the product brand. Advertise `primary_action: "add_to_cart"` only when that connector skill supports the operation. It requires `type: "browser"`, `provider`, and a non-empty `product_id` unique within the widget. `retailer_name` is optional context as required by the connector. Keep both agentic checkout capability flags false. A click queues a normal agent turn requesting one additional unit; it does not mean the cart changed or authorize checkout. Omit the action for ordinary shopping cards to preserve their existing purchase behavior.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| path | string | No | Path returned by `shopping.resolve_results`. Prefer when another tool wrote a `kind: "shopping_results"` JSON file. Exactly one of `path` or `products` must be passed. |
| products | object[] (1-50) | No | Inline product list. Each: `url` (string, required), `name` (string, required), plus optional `citation_id`, `image_url` (string or null), `type` (enum: catalog, marketplace, browser), `product_id`, `provider`, `brand`, `price`, `sale_price`, `retailer_name`, `primary_action` (enum: add_to_cart), `is_agentic_checkout_creation_enabled`, `is_agentic_checkout_completion_enabled`, `is_image_available`. Exactly one of `path` or `products` must be passed. |

Output: Presents the widget immediately as a standalone card.

## social

Search Instagram, Threads, and Facebook by topic, including the user's own posts and activity. For Instagram, Facebook, and Threads links, use the respective CLIs directly. Fall back to `social.search` or browser if the CLI results are insufficient. When using this tool for a specific post, set `post_url` to its exact link instead of translating the link into a query. For a structured read of a specific account, use that service's skill (facebook_cli, instagram, threads) instead. Pair with `browser.search` when a question also spans the open web. On infrastructure errors, fall back to browser.search rather than retrying.

### social.search

Description: Search content across Instagram, Threads, and Facebook, including the user's own posts and activity. Use it for free-text topic search and for direct lookup of an exact social-post URL. For Instagram, Facebook, and Threads links, use the respective CLIs directly. Fall back to `social.search` or browser if the CLI results are insufficient. When using this tool for a specific post, set `post_url` to its exact link instead of translating the link into `semantic_queries`, and instead of opening the link in the browser. Do not combine `post_url` with other fields. Prefer the posts above the line: a source the user cannot read is one they cannot check. Reach below it only when the answer lives nowhere else. Whichever side it sat on, say which language a source is in whenever that is not the language the user is writing to you in.

Input parameters (top two levels):

| Parameter | Type | Required | Description |
|---|---|---|---|
| semantic_queries | string[] | No | Search queries. The FIRST element is the primary query (3-8 words) capturing the core intent; provide 2-4 additional queries targeting different facets. Omit entirely when there is no specific search topic. Do not duplicate values passed in other fields. |
| post_url | string | No | Direct lookup for one exact Instagram, Facebook, or Threads post URL. Do not combine with other fields. |
| authors | string[] or null | No | Hard-filter to posts authored BY specific people (handles with @ prefix, or "@self" for the user's own content). Only when the intent is content FROM/BY someone, not ABOUT them. |
| key_celebrities | string[] | No | Notable people who are the SUBJECT of the query — boosts their authored posts without filtering. |
| relation_to_author | enum: all (default), friend, followee, follower | No | Filter by author's social relationship. |
| platform | enum: facebook, instagram, threads | No | Set ONLY if the user explicitly applies a platform constraint. |
| content_type | enum: image, video | No | Set ONLY when the user constrains the format to images or videos. |
| group_names | string[] | No | Filter to posts from specific Facebook Groups by display name. |
| languages | string[] | No | ISO 639-1 codes steering retrieval toward those languages. Leave unset for ordinary questions. |
| location | string | No | City name, address, or landmark for a geographic search (geotagged posts within ~50km). |
| ranking_intent | enum: informational (default), engagement, recency | No | Determines ranking: informational (most accurate), engagement (popular/trending), recency (time-critical breaking updates only). |
| since | string (YYYY-MM-DD) | No | Filter to posts POSTED on or after this date. |
| until | string (YYYY-MM-DD) | No | Only return posts created on or before this date (historical ranges only). |
| top | integer (max 25, default 6) | No | How many results the call returns (best-effort) from the merged, ranked set. |

Output: Ranked social posts with a summary; results come back with the writing system searched in first, with other-script posts listed below a marked line.

## subagent

Stop a child agent by id when its work is no longer needed or it is stuck. To redirect a struggling agent instead, use subagent.send; to find ids and check state first, use subagent.list.

### subagent.spawn

Description: Delegate a task to a new child agent that works on it in the background while you continue. Do not spawn a generic child for requested website navigation, purchases, or other live-browser work: logged-in sites, clicking, forms, or multi-step interactions. That work belongs to the browser-task delegation route, not another generic child. Generic subagents may search the public web and fetch page text from links supplied by the user or returned by tools; requests to visit or interact with websites are returned to the parent for appropriate delegation. This call is ASYNC: the response only confirms the spawn and returns the new agent id. Results arrive later through the runtime, so never treat the response as completion and never produce results for delegated work yourself. After spawning, acknowledge what you delegated and end your response; do not poll, sleep, or promise a delivery time. Spawn all independent agents at once instead of one at a time. Provide the task in `message`, or in `items` when it needs images or files; `items` takes precedence when both are set. Manage the agent afterwards by its id: `subagent.list` shows status, `subagent.send` delivers follow-up input, `subagent.resume` restarts an interrupted one, and `subagent.close` stops one. Some work has its own dedicated parent-agent capability and cannot be spawned here, including browser tasks, artifacts (a page, app, document, deck, or spreadsheet), and accepted Idea builds. Artifacts do not need a subagent: the artifact tools already run the build in the background and report back. If the user asks for a subagent, tell the child to use the artifact tools instead of creating a file itself. A rejected spawn returns a structured error with a stable reason code; fix the cause it names instead of retrying the same call.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| message | string | No | Task instruction for the child. State the task, the outcome you want, any non-obvious constraint, and every fact it needs. If items is also provided, items takes precedence. |
| items | object[] | No | Multimodal input for the child's first message; takes precedence over message. Each: `type` (enum: text, image, file, required); text requires `text`; image/file require `mime_type` and `data_base64` (raw base64, no data: prefix); optional `filename`, `caption`. |

Output: ASYNC acceptance — confirms the spawn and returns the new agent id. Results arrive later through the runtime.

### subagent.list

Description: List your child agents (in main chat, also other chats' and scheduled jobs' agents), grouped into active and recent, with a normalized status (running, done, interrupted, failed), task and final response previews, timing, and whether a finished result was already seen. Running entries include how long the agent has been running and how long since its last activity. A quiet agent is not proof it is stuck; it may be inside one long tool call. Entries carry the agent ids the other subagent tools need, plus the browser task id for browser task owners and the artifact slug for artifact builders. In main chat each entry's `owner` says whether a chat or a scheduled job owns it, with the schedule and run ids for scheduled work, so a scheduled job's agents are never mistaken for missing. You can view agents owned by another chat or a scheduled job but not steer or stop them here; manage scheduled work with the cron tools. Check status only to act on it: the user asks where things stand, you need an agent id, or you suspect slow or failed work. Finished results are delivered to you automatically; mentioning running work unprompted needs no fresh check, and calling this in a polling loop wastes turns.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| limit | integer (default 20, max 200) | No | Max entries to return. |
| scope | enum: direct (default), descendants | No | 'direct': your immediate children. 'descendants': the full subtree of agents under you. |

Output: Active and recent child agents with normalized status, timing, and result previews.

### subagent.send

Description: Deliver follow-up input to one of your running child agents by id. Delivery is ASYNC: a success response means the message was submitted, not applied. The instruction stays pending until the agent's handoff or completion result reports it, so do not describe it as done, do not poll for it, and do not fabricate the outcome. Handle anything else the turn needs, then end your response. Provide the input in `message`, or in `items` for images or files; `items` takes precedence when both are set. Set `interrupt` true to cut off the agent's current work first, so the new input starts a fresh turn instead of queueing behind the old one. Browser task owners cannot be steered by agent id; their parent agent must use the dedicated browser-task control with its `browser_task_id` instead. To start ordinary delegated work when no suitable agent exists, use `subagent.spawn`.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Target agent id (from subagent.spawn or subagent.list output). |
| message | string | No | Follow-up text for the agent. If items is also provided, items takes precedence. |
| items | object[] | No | Multimodal input (text/image/file); takes precedence over message. Each: `type` (enum: text, image, file, required); text requires `text`; image/file require `mime_type` and `data_base64`; optional `filename`, `caption`. |
| interrupt | boolean | No | If true, interrupt the agent's current work before delivering this input. |
| scope | enum: direct (default), descendants | No | Where the target may live: 'direct' covers your immediate children, 'descendants' the full subtree under you. |

Output: ASYNC — success means the message was submitted, not applied.

### subagent.resume

Description: Resume one of your interrupted child agents by id so it continues its existing task from where it stopped. Only a paused or interrupted agent can be resumed. An agent that already finished or shut down is not resumed; the call returns an error saying so, because resuming a terminal agent re-runs nothing. Spawn a new agent with `subagent.spawn` to continue that work. Resume restarts the agent on its own task; to give it new direction once it is running again, use `subagent.send`. Two kinds of agents refuse generic resume: browser task owners continue through their parent agent's dedicated browser-task control, and a web artifact builder whose build is still in flight cannot be resumed; wait for it to finish or send it guidance with `subagent.send`.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Target agent id (from subagent.spawn or subagent.list output). |
| scope | enum: direct (default), descendants | No | Where the target may live: 'direct' covers your immediate children, 'descendants' the full subtree under you. |

Output: Return shape not specified in schema.

### subagent.close

Description: Stop one of your child agents by id and end its work. Use this when the delegated work is no longer needed, the agent is stuck, or it should not keep going. To redirect an agent instead of stopping it, use `subagent.send`; to find the right id and check state first, use `subagent.list`. Closing a browser task owner stops the whole browser task: the response then includes its `browser_task_id`, and next time its parent agent can close that task through the dedicated browser-task control. If a browser task owner has no task id on record, the error explains how the parent agent can find and close the task there.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Target agent id (from subagent.spawn or subagent.list output). |
| scope | enum: direct (default), descendants | No | Where the target may live: 'direct' covers your immediate children, 'descendants' the full subtree under you. |

Output: Return shape not specified in schema (closing a browser task owner includes its `browser_task_id`).

## todo

Schema unavailable in the compilation context. Functions are not listed.

## tool_search

Load all function schemas for one or more deferred tool namespaces before calling their functions for the first time.

### tool_search.load_tool_namespace

Description: Load all function descriptions and parameter schemas for one or more tool namespaces. Use when a namespace or one of its functions is marked deferred and its full interface is not already in context. Call this with the namespace names in `paths` and it returns the full function interfaces, after which those functions are callable normally. A namespace counts as loaded while the full interfaces from its load are still in your context: call its functions directly rather than loading it again. Functions whose full schemas are provided up front are already callable without loading. This tool is only for the tool namespaces listed in the tool list: that list is the complete loadable set, so never attempt to load a name that is not on it. Skills are not tool namespaces — capabilities from connected accounts and apps (email, calendar, retailer accounts, music, and similar) are skills; discover those with muse.skill_search, never with this tool.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| paths | string[] | Yes | List of namespace names to load. |

Output: The full function interfaces (descriptions and parameter schemas) for the loaded namespaces.

## tracking

Track concrete plans, commitments, and outcomes the user cares about beyond the immediate conversation: reservations, deliveries, reminders, trips, and ongoing projects. Do not require an explicit request to track them or a minimum amount of work. Keep the item open while the relevant event, delivery, or follow-up is still pending, even if booking or checkout is complete. Skip ordinary conversation and requests whose outcome is fully resolved in the current turn. Associate the work with its existing goal or tracked item before scheduling a call, cron, heartbeat check, or other background mechanism. Close a reminder once delivered and nothing remains owed.

When work belongs to an existing tracked item, associate it with that item. When the user explicitly restarts a completed responsibility, reopen that existing item with set_status; never create a replacement instance. Create a new tracked item only when no existing record represents the responsibility - and an active user goal is such a record: never create a tracked item, subgoal, or any second goal record to represent check-ins, accountability, or monitoring for a user goal that exists. Attach the cron or check-in to that goal (cron owner `goal:<goal-slug>`) and log progress in the user_goal namespace.

Close tracked items proactively when the best available evidence shows the responsibility ended; do not wait for the user. Use conversation history, goal state, completed work or tool results, reliable real-world facts, and current time relative to known dates. Respect an explicit stop immediately. Examples: delivery received; event ended; target reached; window expired; user cancelled. Silence or one finished step alone is not enough. Call `tracking.set_status` with `completed` in the same turn when that evidence arrives. An activity entry or a refreshed pulse does not close the item. Close it even when its activity log already records the outcome.

Use the list, search, and get functions to resolve identity before creating or updating. Search matches terms across ids, titles, `current_state`, and descriptions and returns lifecycle state and timestamps.

Every set_status call requires a concise user-facing `reason` explaining the transition.

Each tracked item has a workspace at `workspace/goals/<goal-slug>/`; read its `GOAL.md` first before doing anything related to the item. Documents the user asked for go in `workspace/goals/<goal-slug>/files/`, which the user sees as the item's documents; check logs, watermarks, snapshots, and other bookkeeping go in `workspace/goals/<goal-slug>/hidden_files/`, which the user does not see. Do not add unrequested files under `workspace/goals/<goal-slug>/files/` or `workspace/your_files/`: a check-in records its outcome with `create_entry`, not as a new document.

### tracking.create

Description: Create a tracked item for a concrete plan, commitment, or outcome the user cares about beyond the immediate conversation, such as a reservation, delivery, reminder, trip, or ongoing project. Track it even when the user does not say "track this" or the next step is quick. Keep it open while the relevant event, delivery, or follow-up is still pending, even if booking or checkout is complete. Skip ordinary conversation and requests whose outcome is fully resolved in the current turn. Associate the work with its tracked item before scheduling a call, cron, heartbeat check, or other background mechanism. For a user-requested reminder, record the scheduled time as when the user is due and close the item once the reminder is delivered and nothing remains owed. Before creating, resolve identity with `tracking.list` or `tracking.search`: when the work belongs to an existing tracked item, log to that item with `tracking.create_entry` instead, and when the user explicitly restarts a completed responsibility, reopen that item with `tracking.set_status`; never create a replacement instance. An active user goal is such an existing record: when the work serves one of the user's existing goals (accountability, check-ins, nudges, monitoring, or reminders for that goal's outcome), it belongs on that goal as goal-owned schedules and timeline entries, never as a new tracked item, subgoal, or second goal record shadowing the goal. Attach the cron or check-in to that goal (cron owner `goal:<goal-slug>`) and log progress with `user_goal.create_entry`. Give the item a `title` that is a concise noun phrase naming the work itself, a one-line `current_state` pulse, and a two or three sentence `description`; detailed progress belongs in activity entries, not the description. Optionally nest it under a top-level tracked item with `parent_goal_id`, and classify it with `goal_kind` and `value_alignment`. Creation returns the new item immediately, including its `goal_id`. Each created item gets a workspace at `workspace/goals/<goal-slug>/` with a `GOAL.md`; read that file before doing later work on the item.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| title | string | Yes | Concise user-facing noun phrase naming the work itself, not an instruction. Avoid generic leading verbs like `Track ...`; use concrete domain wording (`Wimbledon daily analysis`, `Childcare coordination`). Current activity and status go in current_state. |
| current_state | string | Yes | The one-line user-facing state. Write one short pulse from the newest evidence that states the single most useful current or forward-looking status: a result, progress marker, specific wait, blocker, monitored condition, or scheduled event. Do not claim work is currently in progress, append a generic next step, or restate the title or description. |
| description | string | Yes | Two or three natural, user-facing sentences that explain the tracked work at a high level. Put detailed progress and state changes in activity entries instead. |
| parent_goal_id | string | No | Id of an existing TOP-LEVEL tracked item to nest this one under. The parent must itself be assistant-tracked work, not a user goal. |
| goal_kind | string | No | outcome = result to achieve. behavior = action pattern to adopt. learning = skill to acquire. habit = recurring practice. maintenance = hold a standard. recovery = return from a setback. identity = who the user wants to become. exploratory = open-ended discovery. |
| value_alignment | string | No | Short user-facing note on why this work matters to the user. |
| emoji | string | No | Single emoji for the item. Defaults to a generic goal emoji when omitted. |

Output: The new tracked item, including its `goal_id`.

### tracking.get

Description: Read one tracked work item in full by its `goal_id`. Returns the item's metadata (title, `current_state` pulse, description, lifecycle status, parent linkage) together with its complete activity timeline, plus any pending suggestions, associations, and recent briefings. Each timeline entry carries its `update_id`, title, outcome line, description, and effective time; those `update_id` values are what `tracking.update_entry` and `tracking.delete_entry` take. Each tracked item also has a workspace directory at `workspace/goals/<goal-slug>/`; read its `GOAL.md` before doing any substantial work related to the item. When you do not know the `goal_id`, find it with `tracking.list` or `tracking.search` first.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| goal_id | string | Yes | Exact tracked item id to read. Tracked item id, as returned by tracking.list, tracking.search, or tracking.create. |

Output: The item's metadata, complete activity timeline, pending suggestions, associations, and recent briefings.

### tracking.list

Description: List the work items you are tracking for the user. Returns up to `limit` items (default 100) with each item's id, title, `current_state` (the one-line status pulse), description, lifecycle status, timestamps, and parent linkage, plus any storage warnings. Items here are assistant-tracked responsibilities: monitoring, follow-ups, background work, and other work you carry across turns on the user's behalf. The user's own goals are a separate surface and never appear here. Use it to resolve identity before mutating: check whether a responsibility already has a tracked item before creating one with `tracking.create`, and confirm the exact `goal_id` before calling `tracking.update`, `tracking.set_status`, or `tracking.create_entry`. For a keyword lookup across a long roster use `tracking.search`; for one item's full timeline use `tracking.get`.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| limit | integer (default 100) | No | Maximum number of items to return. |
| offset | integer (min 0) | No | Use next_offset from the previous page; omit for the first page. |

Output: Up to `limit` tracked items with id, title, state, description, lifecycle status, timestamps, parent linkage, and storage warnings.

### tracking.search

Description: Search your tracked work items with keyword terms. Terms match case-insensitively against each item's id, title, `current_state`, and description; words shorter than two characters are ignored, and the query must contain at least one term of two or more characters. Matches cover every lifecycle state, so completed items are found too. Results are ranked by how many terms match, then by most recent update, and return compact projections (long text fields are cut at 2,000 characters) with lifecycle status, timestamps, and parent linkage, plus the total match count. Returns at most `limit` matches (default 10, maximum 100). Use it to resolve whether a responsibility already has a tracked item before creating a new one with `tracking.create`, and to find ids for `tracking.get`, `tracking.update`, or `tracking.set_status`. For a plain bounded roster with full text use `tracking.list` instead.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| query | string | Yes | Terms to match against tracked item id, title, current_state, and description. Words shorter than two characters are ignored; at least one longer term is required. |
| limit | integer (default 10, max 100) | No | Maximum matches to return. |

Output: Ranked matches with compact projections, lifecycle status, timestamps, parent linkage, and total match count.

### tracking.create_entry

Description: Add one activity entry to a tracked item's timeline. Log activity incrementally whenever anything happens on tracked work, including a step starting or completing, a check, new or confirmed information, deliverable progress, an artifact change, a result, checkpoint, check-in, feedback, direction change, blocker, schedule change, or lifecycle change. Do not wait for a milestone or material change. Keep the entry concise and user-facing, say what happened and, when applicable, what the result was, and record each activity once. The runtime reads each new entry and replaces the item's `current_state` pulse when the activity supports a newer or more useful current or forward-looking status, and otherwise preserves it; it also refreshes the item's attention state. Do not make a separate `tracking.update` call for that state decision. An entry does not change lifecycle status. When the whole tracked responsibility has ended, close the item with `tracking.set_status` in the same turn. Find the item's `goal_id` with `tracking.list` or `tracking.search`, or create the item first with `tracking.create`.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| title | string | Yes | Concise user-facing title for this activity entry. |
| current_state | string | Yes | State the activity's main outcome in one line. |
| description | string | Yes | One concise, human-friendly sentence about what happened and, when applicable, what the result was. |
| goal_id | string | Yes | Tracked item id, as returned by tracking.list, tracking.search, or tracking.create. |
| effective_at | string | No | When the activity actually happened. Accepts RFC 3339 timestamps or `YYYY-MM-DD`. Defaults to now. |

Output: Return shape not specified in schema.

### tracking.update_entry

Description: Edit an existing activity entry on a tracked item's timeline. Pass the entry's `update_id` (from the timeline `tracking.get` returns) and at least one of `title`, `current_state`, `description`, or `effective_at`; omitted fields keep their current values, and any field you pass must be non-empty. Keep the entry concise and user-facing, saying what happened and, when applicable, what the result was. `current_state` states the activity's main outcome in one line. `effective_at` accepts RFC 3339 timestamps or `YYYY-MM-DD`. Editing an entry also triggers a refresh of the tracked item's attention state. Use this only to correct an entry that is already recorded; new activity gets its own `tracking.create_entry` call, and item-level metadata corrections go through `tracking.update`.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| update_id | string | Yes | Activity entry id, from the timeline tracking.get returns. |
| title | string | No | Concise user-facing title for this activity entry. |
| current_state | string | No | State the activity's main outcome in one line. |
| description | string | No | One concise, human-friendly sentence about what happened and, when applicable, what the result was. |
| effective_at | string | No | When the activity actually happened. Accepts RFC 3339 timestamps or YYYY-MM-DD. Defaults to now. |
| goal_id | string | Yes | Tracked item id, as returned by tracking.list, tracking.search, or tracking.create. |

Output: Return shape not specified in schema.

### tracking.delete_entry

Description: Delete one activity entry from a tracked item's timeline by its `update_id` (from the timeline `tracking.get` returns). The response confirms the deleted entry's id, its item's `goal_id`, and its title. This removes only the single entry; the tracked item itself and the rest of its history stay. To fix a wrong entry instead of removing it, use `tracking.update_entry`. To remove the whole item use `tracking.delete`, and to close finished work use `tracking.set_status`.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| update_id | string | Yes | Activity entry id, from the timeline tracking.get returns. |

Output: Confirms the deleted entry's id, its item's `goal_id`, and its title.

### tracking.update

Description: Patch a tracked work item's metadata by `goal_id`: title, `current_state`, description, parent linkage, `goal_kind`, or `value_alignment`. Only the fields you pass change. Use it only for an explicit correction that is not already represented by new activity: when something happened, log it with `tracking.create_entry` instead, and the runtime refreshes the item's `current_state` pulse from that entry on its own. Do not make an update call solely to restate progress or append a generic next step. Lifecycle is not editable here; open or complete the item with `tracking.set_status`. `parent_goal_id` moves the item under a new parent, which must be a top-level tracked item; pass an empty string to detach the item to top-level. The target must be an assistant-tracked item; this tool cannot edit the user's own goals. Find the exact `goal_id` with `tracking.list` or `tracking.search`. `escalation` is what to do if a stated condition is not met by a date: `{condition, due_at, action}` with `action` `notify` (tell the user) or `ask` (the user must decide next). Set it only from something the user said, a conditional follow-up or a hard deadline with a consequence they named, and only after they confirm it; pass `null` to clear a stored escalation the user has withdrawn or that no longer applies. Omit to keep it unchanged. Never infer one from elapsed time or a soft deadline.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| goal_id | string | Yes | Tracked item id, as returned by tracking.list, tracking.search, or tracking.create. |
| title | string | No | Concise user-facing title for the tracked work. |
| current_state | string | No | The one-line user-facing state. Use update only for an explicit correction that is not already represented by a new activity entry. |
| description | string | No | Two or three natural, user-facing sentences that explain the tracked work at a high level. |
| parent_goal_id | string | No | Move the item under a new parent, which must be a top-level tracked item; pass an empty string to detach the item to top-level. |
| goal_kind | string | No | outcome, behavior, learning, habit, maintenance, recovery, identity, or exploratory. |
| value_alignment | string | No | Short user-facing note on why this work matters to the user. |
| escalation | object or null | No | `{condition, due_at, action}` with `action` `notify` or `ask`. Set only from something the user said; pass null to clear one they withdrew. Omit to keep it unchanged. |

Output: Return shape not specified in schema.

### tracking.set_status

Description: Set a tracked work item's lifecycle to active or completed, with a required user-facing `reason` explaining the transition. This is the complete lifecycle: active means the responsibility remains open, completed means it ended. Close tracked items proactively when the best available evidence shows the responsibility ended; do not wait for the user. Use conversation history, completed work or tool results, reliable real-world facts, and current time relative to known dates. Respect an explicit stop immediately. Examples: delivery received; event ended; target reached; window expired; user cancelled. Silence or one finished step alone is not enough. Use active only to reopen the existing completed item when the user explicitly restarts that responsibility; never create a replacement item with `tracking.create`. The change runs through the daemon's tracking lifecycle coordinator, which may also record a closing or reopening activity entry; the response says whether anything changed and includes any recorded entry. Find the `goal_id` with `tracking.list` or `tracking.search`.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| goal_id | string | Yes | Tracked item id, as returned by tracking.list, tracking.search, or tracking.create. |
| status | enum: active, completed | Yes | The complete lifecycle for tracked work: active means the responsibility remains open, completed means it ended. |
| reason | string | Yes | Concise user-facing explanation of why the lifecycle changed. Required. |

Output: Whether anything changed, including any recorded closing/reopening entry.

### tracking.delete

Description: Permanently delete a tracked work item by `goal_id`, removing it and its activity timeline from the tracked-work roster. Files from the item's `workspace/goals/<goal-slug>/` directory are preserved on disk, and the response lists the preserved paths. Deleting is for mistakes and for items the user explicitly asks to remove. When the responsibility simply ended (shipped, event over, target reached, window expired, user cancelled), close it with `tracking.set_status` completed instead so the record and its history stay available. To remove a single wrong timeline entry rather than the whole item, use `tracking.delete_entry`.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| goal_id | string | Yes | Tracked item id to delete permanently. Tracked item id, as returned by tracking.list, tracking.search, or tracking.create. |

Output: The response lists the preserved file paths from the item's workspace directory.

## trash

List Muse trash entries with their trash_id, status, expiry date, original path, and top-level contents. Read-only. Use it to find the trash_id an entry needs for trash.restore.

### trash.list

Description: List every entry in Muse's recoverable trash. Read-only and takes no parameters. Returns a markdown table sorted newest first with each entry's trash_id, status (active, restored, or expired), expiry date, original path, and top-level contents. Only entries with status active can still be restored: a restored entry keeps its metadata as an audit record, and an expired entry's content has already been removed. Active content stays inspectable under `~/.local/share/Trash/hatch/<trash_id>/files/` until it expires, 30 days after trashing. Use this to find the trash_id that trash.restore needs, or to confirm what an earlier trash.put captured. To trash something use trash.put; to recover an entry use trash.restore.

Input parameters: none (takes no parameters).

Output: A markdown table (newest first) of trash_id, status, expiry date, original path, and top-level contents.

### trash.put

Description: Move one file or directory into Muse's recoverable trash and get back a trash_id for later recovery. Use this instead of permanent deletion (such as rm through exec) whenever removing user files should be reversible: workspace cleanup, replacing an old version, or any destructive file-removal flow. The path resolves against the agent home directory; the entry must exist, and a trailing symlink is trashed as the symlink itself, never followed to its target. The move is a rename into `~/.local/share/Trash/hatch/<trash_id>/files/`, so the source must live on the same filesystem as the home directory, and the trash directory itself is refused. The result reports the trash_id, the original path, the trashed location, and the expiry date. Entries are cleaned up automatically 30 days after trashing; until then the trashed content stays inspectable under `~/.local/share/Trash/hatch/<trash_id>/files/`. To review what is in the trash use trash.list; to bring an entry back use trash.restore.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| path | string | Yes | File or directory to move into recoverable trash. Relative paths resolve against the agent home directory. The entry must exist; a trailing symlink is trashed as the symlink itself, not its target. |

Output: The trash_id, original path, trashed location, and expiry date.

### trash.restore

Description: Move an active trash entry back out of Muse's recoverable trash. trash_id is the id returned by trash.put or shown by trash.list; only an entry with status active can be restored, and a restored or expired entry fails with an error. By default the entry returns to the original path recorded when it was trashed; pass custom_path to restore it somewhere else. Both destinations resolve against the agent home directory, and missing parent directories are created as needed. Restore never overwrites an existing path: if the destination is already occupied the call fails, so inspect the occupant, pick a new name or directory, and call again with custom_path. On success the result reports the trash_id, the original path, and the restored path, and the entry's metadata stays behind as an audit record. To find an entry's id first use trash.list; to trash something use trash.restore.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| trash_id | string | Yes | Trash id returned by trash.put or shown by trash.list. Only an entry with status active can be restored. |
| custom_path | string | No | Optional destination path; resolves against the agent home directory. If omitted or blank, the entry is restored to its recorded original path. Restore never overwrites an existing path; on a conflict, retry with a new name or directory here. |

Output: The trash_id, original path, and restored path.

## ui

Drive the user's active app UI alongside your prose reply. Reach for these functions when showing the right view helps more than describing it, but still answer in prose. Use `mode="perform"` for explicit UI commands and `mode="suggest"` for helpful unrequested UI changes; if unsure, default to `perform`. Omitted `mode` defaults to `perform`. Do not claim a view is open unless the call succeeds. Targets vary by client. Before driving a target you have not confirmed in this conversation, and after any rejected target, call ui.list to see exactly what the active client declares right now, then retry with one of those targets. Use `ui.create_navigation_widget` to create a card the user can tap later. It stores the selected control and returns a widget token; the client runs the control when the user taps the card. Creation success does not mean the view is open.

Note: the namespace description also names `ui.list`; its schema was not returned, so it is not documented here to avoid guessing.

### ui.create_navigation_widget

Description: Create a native card that opens an app tab or invokes a UI control when tapped. Use a navigation card for app navigation such as opening a tab or view. The widget only stores the control; the client performs it on click, and an unknown `target` fails there, not at creation. `{ title: string, ui_control: { action: "navigate" | "set", target: string, params: object, mode: "suggest" | "perform" }, summary?: string, image_path?: string, icon?: string }` Create a transient in-chat widget. Pass its fields directly as tool arguments. By default, place the returned `embed_token` in your message where the widget belongs. An unused token leaves the widget invisible. Set `present_now: true` only to present it immediately as a standalone card. If you are a subagent or background worker, leave `present_now` false and include the unchanged `embed_token` in your final report. Use file or web-artifact tools for documents, dashboards, and apps the user keeps or revisits. In TypeScript-style shapes, `?` marks an optional field; every other field is required.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| title | string | Yes | (widget title) |
| ui_control | object | Yes | `{ action: "navigate" \| "set", target: string, params: object, mode: "suggest" \| "perform" }` — action (required), target (required), params (object, required), mode (required). |
| summary | string | No | (optional summary) |
| image_path | string | No | (optional image path) |
| icon | string | No | (optional icon) |
| present_now | boolean | No | Present immediately as a standalone card. Otherwise embed the returned token in the message. |

Output: Returns an `embed_token` for the navigation card.

## user_goal

Durable goals the user is working toward. Create a goal when the user is working toward an enduring outcome, behavior, or area of life. Recognize durable goals even when the user never says "goal": repeated aspirations, progress updates, setbacks, commitments with a timeframe, or asking for help with a whole area of life. Not goals: fleeting todos, one-time reminders, minor updates that belong on an existing goal, or work you carry for the user (that is the tracking namespace). Clarify one question at a time (use `muse.create_options` for a bounded choice; do not list options in prose). Clarify the outcome the user wants when it is unclear. Offer practical help. Raise a goal only when relevant to the current conversation, and log milestone wins that same turn without derailing the topic. Use the list, search, and get functions to resolve goal identity before creating or updating. Search matches terms across goal ids, titles, `current_state`, and descriptions and returns lifecycle state and timestamps. Every set_status call requires a concise user-facing `reason` explaining the transition. Proactive Letters delivered in chat are produced from these goals; when the user asks to stop them, set `pushable: false` on that goal with `user_goal.update` (that goal's Letters still appear in the Goals tab). Each existing goal has a workspace at `workspace/goals/<goal-slug>/`; before updating or helping with an existing goal, read its `GOAL.md` first. `workspace/goals/<goal-slug>/GOAL.md` is your own notes on the goal rather than a document for the user. Write in `workspace/goals/<goal-slug>/GOAL.md` where the goal stands now, the user's constraints on the goal such as schedule, injuries, budget, or boundaries, the facts you learned while setting the goal up, and the current shape of the plan. Update `workspace/goals/<goal-slug>/GOAL.md` with the file tools when you finish setting a goal up, when a constraint or the plan changes, and when helping with the goal reveals information worth keeping. When a goal is created, the runtime seeds `workspace/goals/<goal-slug>/GOAL.md` with a header carrying the goal's title, id, slug, and description. The runtime does not write to `workspace/goals/<goal-slug>/GOAL.md` again. All of `workspace/goals/<goal-slug>/GOAL.md` is yours to edit, the seeded header included. Renaming or recategorizing a goal updates the goal record but not `workspace/goals/<goal-slug>/GOAL.md`, so the seeded header can go stale. When the seeded header and the goal record disagree, trust the goal record from `user_goal.get`. Record progress with `create_entry` even when you have already written that progress into `workspace/goals/<goal-slug>/GOAL.md`. Documents the user asked for go in `workspace/goals/<goal-slug>/files/`, which the user sees as the goal's documents; check logs, watermarks, snapshots, and other bookkeeping go in `workspace/goals/<goal-slug>/hidden_files/`, which the user does not see. Do not add unrequested files under `workspace/goals/<goal-slug>/files/` or `workspace/your_files/`: record progress with `create_entry`, not as a new document. When helping with an existing goal in a later conversation, read `/opt/hatch/skills/goals/SKILL.md` and that goal category's scaffold at `/opt/hatch/skills/goals/guides/<category>/scaffold.md`. The goal record carries the category, so confirm with `user_goal.get` before concluding a goal has none. When the record's own category is absent, read `/opt/hatch/skills/goals/SKILL.md` alone.

### user_goal.create

Description: For a new goal, your first response is conversational - never a create call - unless the opening message already carries concrete specifics (a target, baseline, deadline, or success condition): brief intake first, then one created record, and only then durable support. Create a goal when the user is working toward an enduring outcome, behavior, or area of life. Recognize durable goals even when the user never says goal: repeated aspirations, progress updates, setbacks, commitments with a timeframe, or asking for help with a whole area of life. Not goals: fleeting todos, one-time reminders, minor updates that belong on an existing goal, or work you track for the user on their behalf (that is `tracking.create`). Clarify one question at a time (use `muse.create_options` for a bounded choice; do not list options in prose) and clarify the outcome the user wants when it is unclear. Offer practical help. Raise a goal only when relevant to the current conversation. A goal-creation contract may already be injected into this conversation (the Goals tab does this automatically). When it is, that injected contract is the complete creation guide: run intake and create the goal directly from it, with zero guidance reads - the goals skill files add nothing to the injected contract, and a read only delays your first question. Only when no goal-creation contract for this new goal's category is in context, read `/opt/hatch/skills/goals/creation/<category>.md` before intake. Choose the category from the life-area `category` values this tool accepts; when none fits, read `/opt/hatch/skills/goals/creation/something_else.md`. Account connections, builds, and monitoring are offered only after the record exists, and built only on the user's confirmation - never silently. Offer a connection as a widget with a "Not now" option, never as a raw link in prose. Before creating, resolve identity with `user_goal.list` or `user_goal.search`: when the aspiration matches an existing goal, log progress to it with `user_goal.create_entry` instead, and when the user explicitly restarts a completed goal, reopen it with `user_goal.set_status`; never create a replacement. Give the goal a `title` that is a concise noun phrase naming the goal itself, a one-line `current_state` pulse, and a two or three sentence `description`; detailed progress belongs in activity entries. Optionally nest it under a top-level user goal with `parent_goal_id`, pick a life-area `category`, and classify it with `goal_kind` and `value_alignment`. When the user is creating from the app's goal creation flow, a missing `category` is filled from the area they chose there. Creation returns the new goal immediately, including its `goal_id`, and sets up its workspace at `workspace/goals/<goal-slug>/`. When helping with an existing goal in a later conversation, read `/opt/hatch/skills/goals/SKILL.md` and that goal category's scaffold at `/opt/hatch/skills/goals/guides/<category>/scaffold.md`. The goal record carries the category, so confirm with `user_goal.get` before concluding a goal has none. When the record's own category is absent, read `/opt/hatch/skills/goals/SKILL.md` alone.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| title | string | Yes | Concise user-facing noun phrase naming the goal itself, not an instruction. Avoid generic leading verbs like `Track ...`; use concrete domain wording (`Marathon under four hours`, `Career change to product design`). Current activity and status go in current_state. |
| current_state | string | Yes | The one-line user-facing state. Write one short pulse from the newest evidence that states the single most useful current or forward-looking status: a result, progress marker, specific wait, blocker, monitored condition, or scheduled event. Do not claim work is currently in progress, append a generic next step, or restate the title or description. |
| description | string | Yes | Two or three natural, user-facing sentences that explain the goal at a high level. Put detailed progress and state changes in activity entries instead. |
| parent_goal_id | string | No | Id of an existing TOP-LEVEL user goal to nest this one under. The parent must itself be a user goal, not assistant-tracked work. |
| category | enum: health, relationships, money, career, interests, productivity, something_else | No | Life area for the goal. The value stays on the goal record as the goal's category. A creation turn reads that category's guide at /opt/hatch/skills/goals/creation/<category>.md. A coaching turn reads that category's scaffold at /opt/hatch/skills/goals/guides/<category>/scaffold.md. When the user is creating from the app's goal creation flow and this is omitted, the area they chose there is used. |
| goal_kind | enum: outcome, behavior, learning, habit, maintenance, recovery, identity, exploratory | No | outcome = result to achieve. behavior = action pattern to adopt. learning = skill to acquire (spaced study). habit = recurring practice. maintenance = hold a standard. recovery = return from a setback. identity = who the user wants to become. exploratory = open-ended discovery. |
| value_alignment | string | No | Short user-facing note on why this goal matters to the user. |
| emoji | string | No | Single emoji for the goal. Defaults to a generic goal emoji when omitted. |

Output: The new goal immediately, including its `goal_id`; sets up its workspace at `workspace/goals/<goal-slug>/`.

### user_goal.get

Description: Read one user goal by its exact `goal_id`. Returns the goal's metadata (title, `current_state` pulse, description, lifecycle status, category - `null` for an uncategorized record - and parent linkage), its full timeline of dated activity entries, and its suggestions, associations, and briefings. When you do not know the id, find it with `user_goal.list` or `user_goal.search` first. Each goal has a workspace at `workspace/goals/<goal-slug>/`; read its `GOAL.md` before doing anything substantial related to the goal. Timeline entries carry an `update_id`, which `user_goal.update_entry` and `user_goal.delete_entry` take.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| goal_id | string | Yes | Exact goal id, as returned by user_goal.list, user_goal.search, or user_goal.create. |

Output: The goal's metadata, full timeline of dated activity entries, suggestions, associations, and briefings.

### user_goal.list

Description: List the user's own goals. Returns up to `limit` goals (default 100) with each goal's id, title, `current_state` (the one-line status pulse), description, lifecycle status, category (`null` for an uncategorized record), timestamps, and parent linkage, plus any storage warnings. Goals here are the user's durable aspirations and commitments. Work you track for the user on their behalf is a separate surface and never appears here; list that with `tracking.list`. Use it to resolve goal identity before mutating: check whether an aspiration already has a goal before creating one with `user_goal.create`, and confirm the exact `goal_id` before calling `user_goal.update`, `user_goal.set_status`, or `user_goal.create_entry`. For a keyword lookup across a long roster use `user_goal.search`; for one goal's full timeline use `user_goal.get`.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| limit | integer (1-100, default 100) | No | Maximum number of goals to return. |
| offset | integer (min 0) | No | Use next_offset from the previous page; omit for the first page. |

Output: Up to `limit` goals with id, title, state, description, lifecycle status, category, timestamps, parent linkage, and storage warnings.

### user_goal.search

Description: Search the user's goals with keyword terms. Terms match case-insensitively against each goal's id, title, `current_state`, and description, across every lifecycle state including completed goals. Results are ranked by how many terms match, then by most recent update, and come back as compact projections with lifecycle status, category (`null` for an uncategorized record), and timestamps plus a total `match_count`. The `query` needs at least one term of two or more characters; `limit` defaults to 10 (maximum 100). Prefer this over `user_goal.list` when the roster is long and you are hunting for one specific goal, including checking whether a past or completed goal already covers what the user just described. Work you track for the user is a separate surface; search that with `tracking.search`.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| query | string | Yes | Terms to match against goal id, title, current_state, and description. At least one term of two or more characters. |
| limit | integer (default 10, max 100) | No | Maximum number of matches to return. |

Output: Ranked compact projections with lifecycle status, category, timestamps, and total `match_count`.

### user_goal.create_entry

Description: Add one activity entry to a user goal's timeline. Log an entry when the user reports progress, a result, a setback, a milestone, or a decision that moves or changes the goal; log milestone wins the same turn they happen without derailing the conversation. Keep the entry concise and user-facing, say what happened and any result, and record each activity once. The runtime reads each new entry and replaces the goal's `current_state` pulse when the activity supports a newer or more useful current or forward-looking status, and otherwise preserves it. Do not make a separate `user_goal.update` call for that state decision. An entry on a nested goal is also rolled up onto its parent goal's timeline automatically. Use `effective_at` when logging something that happened earlier than now; it accepts RFC 3339 timestamps or YYYY-MM-DD and defaults to now. Find the goal's `goal_id` with `user_goal.list` or `user_goal.search`, or create the goal first with `user_goal.create`.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| title | string | Yes | Concise user-facing title for this activity entry. |
| current_state | string | Yes | State the activity's main outcome in one line. |
| description | string | Yes | One concise, human-friendly sentence about what happened and, when applicable, what the result was. |
| goal_id | string | Yes | Goal id, as returned by user_goal.list, user_goal.search, or user_goal.create. |
| effective_at | string | No | When the activity actually happened. Accepts RFC 3339 timestamps or YYYY-MM-DD. Defaults to now. |

Output: Return shape not specified in schema.

### user_goal.update_entry

Description: Edit one existing activity entry on a goal's timeline. Provide the entry's `update_id` (from the timeline `user_goal.get` returns) plus at least one of `title`, `current_state`, `description`, or `effective_at`; a call changing none of them is rejected. Use it to fix wording, correct the outcome line, or move the entry to when the activity actually happened. Keep the entry concise and user-facing, saying what happened and, when applicable, what the result was. This edits the entry in place; it does not re-run the state decision that `user_goal.create_entry` triggers. For new activity add a new entry with `user_goal.create_entry` instead, and to remove an entry use `user_goal.delete_entry`.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| update_id | string | Yes | Activity entry id, from the timeline user_goal.get returns. |
| title | string | No | Concise user-facing title for this activity entry. |
| current_state | string | No | State the activity's main outcome in one line. |
| description | string | No | One concise, human-friendly sentence about what happened and, when applicable, what the result was. |
| effective_at | string | No | When the activity actually happened. Accepts RFC 3339 timestamps or YYYY-MM-DD. Defaults to now. |

Output: Return shape not specified in schema.

### user_goal.delete_entry

Description: Delete one activity entry from a user goal's timeline by its `update_id`, taken from the timeline `user_goal.get` returns. The response echoes the deleted entry's id, goal, and title. Use it to remove a duplicate or mistaken entry. It does not touch the goal itself or recompute the goal's `current_state`; correct a wrong entry with `user_goal.update_entry` instead of deleting and re-adding, and delete a whole goal with `user_goal.delete`.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| update_id | string | Yes | Activity entry id, from the timeline user_goal.get returns. |

Output: Echoes the deleted entry's id, goal, and title.

### user_goal.update

Description: Update a user goal's metadata: `title`, `current_state`, `description`, `category`, `goal_kind`, `value_alignment`, parent linkage, or brief pushes. Provide the `goal_id` plus only the fields you are changing. Use it only for an explicit correction that is not already represented by a new activity entry, and do not append a generic next step to the state line. New progress, results, or events belong on the timeline via `user_goal.create_entry` (the runtime refreshes `current_state` from entries itself), and lifecycle changes belong to `user_goal.set_status`. Use `parent_goal_id` to move the goal under a new top-level user goal, or pass an empty string to detach it to top level. Set `pushable` to false when the user says to stop proactive brief pushes for this goal; briefs still show when they read the Goals tab. Find the exact `goal_id` with `user_goal.list` or `user_goal.search`. `escalation` is what to do if a stated condition is not met by a date: `{condition, due_at, action}` with `action` `notify` (tell the user) or `ask` (the user must decide next). Set it only from something the user said, a conditional follow-up or a hard deadline with a consequence they named, and only after they confirm it; pass `null` to clear a stored escalation the user has withdrawn or that no longer applies. Omit to keep it unchanged. Never infer one from elapsed time or a soft deadline.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| goal_id | string | Yes | Exact goal id, as returned by user_goal.list, user_goal.search, or user_goal.create. |
| title | string | No | Concise user-facing noun phrase naming the goal itself, not an instruction. Avoid generic leading verbs like `Track ...`; use concrete domain wording (`Marathon under four hours`, `Career change to product design`). Current activity and status go in current_state. |
| current_state | string | No | The one-line user-facing state. Write one short pulse from the newest evidence that states the single most useful current or forward-looking status: a result, progress marker, specific wait, blocker, monitored condition, or scheduled event. Do not claim work is currently in progress, append a generic next step, or restate the title or description. |
| description | string | No | Two or three natural, user-facing sentences that explain the goal at a high level. Put detailed progress and state changes in activity entries instead. |
| category | enum: health, relationships, money, career, interests, productivity, something_else | No | Life area for the goal. |
| goal_kind | enum: outcome, behavior, learning, habit, maintenance, recovery, identity, exploratory | No | outcome = result to achieve. behavior = action pattern to adopt. learning = skill to acquire (spaced study). habit = recurring practice. maintenance = hold a standard. recovery = return from a setback. identity = who the user wants to become. exploratory = open-ended discovery. |
| value_alignment | string | No | Short user-facing note on why this goal matters to the user. |
| parent_goal_id | string | No | Id of a TOP-LEVEL user goal to move this one under. Pass an empty string to detach the item to top-level. |
| pushable | boolean | No | Set false when the user says to stop proactive brief pushes for this goal; briefs still show in the Goals tab. Set true to resume pushes. |
| escalation | object or null | No | `{condition, due_at, action}` with `action` `notify` or `ask`. Set only from something the user said; pass null to clear one they withdrew. Omit to keep it unchanged. |

Output: Return shape not specified in schema.

### user_goal.set_status

Description: Set a user goal's lifecycle to active or completed, with a required user-facing `reason` explaining the transition. This is the complete lifecycle: active means the goal remains open, completed means it ended. Complete a goal when the user reaches it, ends it, or clearly moves on from it. Use active only to reopen the existing completed goal when the user explicitly restarts that responsibility; never create a replacement goal with `user_goal.create`. The change may also record a closing or reopening entry on the goal's timeline; the response says whether anything changed and includes any recorded entry. Find the `goal_id` with `user_goal.list` or `user_goal.search`.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| goal_id | string | Yes | Exact goal id, as returned by user_goal.list, user_goal.search, or user_goal.create. |
| status | enum: active, completed | Yes | The complete lifecycle for user goals: active means the goal remains open, completed means it ended. |
| reason | string | Yes | Concise user-facing explanation of why the lifecycle changed. Required. |

Output: Whether anything changed, including any recorded closing/reopening entry.

### user_goal.delete

Description: Permanently delete a user goal by `goal_id`, removing it and its activity timeline from the user's goals. Files from the goal's workspace are preserved on disk, and the response lists their paths. Deletion is for mistakes and for goals the user explicitly asks to remove. A goal the user finished, achieved, or abandoned should instead be completed with `user_goal.set_status`, which keeps its history visible. Confirm the exact `goal_id` with `user_goal.list` or `user_goal.search` first.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| goal_id | string | Yes | Goal id, as returned by user_goal.list, user_goal.search, or user_goal.create. |

Output: The response lists the preserved file paths from the goal's workspace.

### user_goal.delete_briefing

Description: Delete one stored briefing from a user goal, including its briefing HTML and associated hero image. Historical delivery and engagement records are retained. Use the exact briefing_id returned by user_goal.get. This does not delete the goal or its other activity.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| briefing_id | string | Yes | Exact briefing id returned in a user_goal.get briefing record. |

Output: Return shape not specified in schema.

## voice

Schema unavailable in the compilation context. Functions are not listed.

## wallet

Schema unavailable in the compilation context. Functions are not listed.

## widget

Create a transient in-chat widget. Pass its fields directly as tool arguments. By default, place the returned `embed_token` in your message where the widget belongs. An unused token leaves the widget invisible. Set `present_now: true` only to present it immediately as a standalone card. If you are a subagent or background worker, leave `present_now` false and include the unchanged `embed_token` in your final report.

Use file or web-artifact tools for documents, dashboards, and apps the user keeps or revisits.

In TypeScript-style shapes, `?` marks an optional field; every other field is required.

### widget.create_list_widget

Description: Create a native list card of skill-directed results, links, flights, calendar entries, or email entries. Use native list cards for skill-directed results such as flights and fitness classes. Use 1–20 rows. Non-flight rows require non-empty titles. Copy image URLs from source results when available. Use `type: "link"` with an HTTP(S) `data.url` for a row that opens a URL and `type: "send_message"` for a row the user taps to send `data.text` as their reply; calendar and email rows select a glyph only. Omit `type` for a generic row. File rows are unsupported. If the active client cannot render list cards, present the results as Markdown instead.

For a link list, pass arguments like: `{ "title": "Results", "items": [{ "title": "Result name", "type": "link", "data": { "url": "https://example.com/result" } }] }`.

Include `items` in the tool arguments. Add an optional list `title` and `subtitle`; omit `title` for a list without a heading. For a flight list whose action is not booking, add one list-level `flight_action` object with a short single-line `cta_text` and `response_message_prefix`. The runtime appends the selected itinerary and total to that prefix. Omit `flight_action` for the default `Book with <agent_name>` action. Use one action for the whole flight list; do not put action copy in individual rows. Choose action copy appropriate to the current flow, and make `response_message_prefix` describe the same intended action as `cta_text`. For non-flight rows, add optional string fields `subtitle`, `tertiary_title` and `image_url`, or an `icons` array of image URL strings. Set row `type` to "generic", "link", "send_message", "calendar", "email", or "flight".

Use `type: "send_message"` with a non-empty `data.text` string only for rows that offer the user a reply to choose. Use link or generic rows for results. Keep the text aligned with the row's title and subtitle, with no hidden instructions. Creating the widget sends nothing. Copy any supplied `image_url` unchanged and never invent one.

For flights, set row `type` to "flight". Supply either inline `data.flight_data` or `data.flight_details_file` with a JSON file path. Create one row per complete trip, including every slice and connection. Omit `data.slice_index` and row presentation strings.

When flight results are already JSON, save the unchanged search output to a temporary file and pass its path in `data.flight_details_file`. Select one object with `data.json_pointer`, an RFC 6901 pointer such as "/offers/0". Omit the pointer when the whole file is one flight object. Inspect the file to choose result indexes. Do not rewrite or trim its flight objects, or copy them into tool arguments. Keep the file until widget creation succeeds. The runtime loads each file once per list and stores the selected data. File paths and pointers are not stored or sent to clients.

For browser results, supply inline `data.flight_data` or save the same object to a file. Populate it from verified source facts. Preserve known baggage, fare conditions, passenger cabins, and durations. Include source summary facts when detailed passenger facts are unavailable. Omit unknown optional facts. Use a stable private-mapping key for `id` if the source has no offer id. Do not combine inline and file input in one row.

Check the source flight facts before presenting. Present each result set once, using either `present_now` or the returned embed token. Do not present a second copy solely to correct cosmetic details. After presenting, add useful recommendations or caveats without repeating the flight inventory in prose.

For inline rows, include `flight_data` inside the row's `data`. Required `flight_data` fields: `id`, `passengers`, and `slices`. Include at least one slice and at least one segment per slice. Include `segments` for each slice. Include `from`, `to`, `depart`, and `arrive` for each segment. All other flight fields are optional, including segment `passengers`. Within passenger templates, `type` and `age` are optional. Within segment passengers, `cabin` and `bags` are optional. Within baggage objects, `carry_on` and `checked` are optional. Use nonnegative integers for counts and ages; booleans for `nonstop`, `cabin_varies`, and `baggage_varies`; and strings for other scalar values, including `price`. Set `refundable` and `changeable` to "yes", "no", or "not stated". Omit unknown optional fields rather than passing null.

Keep slices and segments in travel order. Use one slice for a one-way trip and two slices for a round trip. Keep connecting flights in their slice's `segments`. Present each complete offer once in one row, from comparison through selection. Do not split outbound and return into separate rows or lists. Treat `price` as the whole trip price for all passengers. Do not invent per-slice prices or combine legs from different offers. Set each segment's `depart` and `arrive` to one airport-local ISO 8601 datetime, such as "2026-09-15T07:35:00", without a timezone suffix. Copy Duffel's segment `departing_at` into `depart` and `arriving_at` into `arrive`. Omit Duffel's display-time strings and the slice-level `depart` and `arrive`. Do not supply formatted timestamps. The server derives slice endpoints and client timestamp strings from the first and last segments. For browser results, obtain the local date and time for every endpoint before creating a flight row. Preserve source duration strings. Preserve known segment cabins and baggage in `segments[].passengers`. The runtime derives cabin and baggage summaries when the detailed facts are complete. Known differences mark variation; missing facts remain unknown. When only source-reported summaries are available, use offer-level `bags` and `slices[].cabin`; retain source-reported `baggage_varies` or `slices[].cabin_varies` when detailed passenger facts are unavailable. Include a slice's source-reported `stops` when technical stops occur within a segment. Otherwise omit it and let the runtime count connections. Preserve each segment's `carrier` name and `flight` number. Put its source IATA or ICAO code in `segments[].carrier_code` when available. Keep codeshare operators separately in `operating_carrier` and `operating_flight`. Omit `response_message`, slice `from` and `to`, offer `stops`, and `nonstop` when authoring flight data. Both input forms receive the same route/stop summaries and an identifying reply before storage. Keep the offer id as the private checkout mapping. The server supplies "Book with <agent_name>" as the CTA when `flight_action` is omitted. When it is present, the server uses its CTA and response prefix while still appending the exact selected itinerary and total. Do not calculate elapsed durations by subtracting airport-local clocks; preserve source durations. Creating a row does not submit it or authorize a purchase. Add `flight_link` only for a verified absolute HTTP(S) details URL. Keep checkout credentials out of the payload.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| items | object[] (1-20) | Yes | List rows. Each: `type` (enum: generic, link, send_message, calendar, email, flight), `title`, `subtitle`, `tertiary_title`, `image_url`, `icons` (image URL strings), `data` (for link rows: `url`; for send_message rows: non-empty `text`; for flight rows: `flight_data` or `flight_details_file` with optional `json_pointer`). |
| title | string | No | Optional list heading; omit for a list without a heading. |
| subtitle | string | No | Optional list subtitle. |
| language | string | No | Language of generated list text as a BCP 47 tag, for example fr-FR. |
| present_now | boolean (default false) | No | Present immediately as a standalone card. Otherwise embed the returned token in the message. |
| flight_action | object | No | For a flight list whose action is not booking: `{ cta_text: string, response_message_prefix: string }`. Omit for the default `Book with <agent_name>` action. Use one action for the whole flight list. |

Output: Returns an `embed_token` (and widget id) for the list card.

### widget.create_map_widget

Description: Create a map showing real-world places and location pins. Prefer `rich_place` elements: they render a photo and a place card, and `places details <place_id>` fetches details whenever you have place ids. Usually omit element `id`s (the server assigns them); supplied ids must be unique, and the `hatch_` prefix is reserved for system pins.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| elements | object[] (1-24) | Yes | Each: `{ kind: "rich_place", place_id: string, name: string, coordinate: { latitude, longitude }, category?, description?, id? }` or `{ kind: "marker", coordinate: { latitude, longitude }, title?, subtitle?, background_image_url?, id? }`. Both require `coordinate`. |
| display_text | string | No | (display text) |
| initial_zoom | integer (1-20) | No | Initial map zoom. |
| motivation | string or null | No | The user need this map answers, one short phrase (for example "dinner options near the theater"); omit when purely illustrative. |
| present_now | boolean | No | Present immediately as a standalone card. Otherwise embed the returned token in the message. |

Output: Returns an `embed_token` (and widget id) for the map.

### widget.create_html_widget

Description: Create compact interactive HTML in the current chat reply. Use an in-chat HTML fragment for controls, picker UIs, small cards, local previews, or charts. Follow every rule in the "HTML widget authoring" section of the `widget` namespace description.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| html | string | Yes | Compact HTML fragment rendered inside the existing iframe shell (no `<!DOCTYPE>`, `<html>`, `<head>`, `<body>` wrappers). Must be theme-aware, never overflow the chat, and stay under 1 MB. |
| display_text | string | No | (display text) |
| fallback_text | string | No | Concise plain-text fallback (max 120 chars) for when the HTML cannot render. |

Output: Returns an `embed_token` (and widget id) for the HTML widget.

### widget.create_html_file_widget

Description: Create an in-chat HTML widget from a local HTML file. Read HTML from a local `.html` or `.htm` file. Relative paths resolve from the home directory; `workspace/...`, `/workspace/...`, `~/...`, `file://...`, and `sandbox://workspace/...` work. Files over 1 MB are rejected: widgets are compact UI, not media containers. Never pass paths under `workspace/your_files/` or `workspace/visual_grounding/`; return those as own-line preview links instead. Follow every rule in the "HTML widget authoring" section of the `widget` namespace description. `{ path: string, display_text?: string, fallback_text?: string }`

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| path | string | Yes | Path to a local `.html` or `.htm` file. |
| display_text | string | No | (display text) |
| fallback_text | string | No | Concise plain-text fallback (max 120 chars) for when the HTML cannot render. |

Output: Returns an `embed_token` (and widget id) for the HTML file widget.

### widget.create_letter_widget

Description: Present an existing briefing or relationship brief as a native Letter. This tool presents the widget immediately as a standalone card. Subagents and background workers cannot call it; report the content back instead. In TypeScript-style shapes, `?` marks an optional field; every other field is required. `{ content: { type: "briefing" \| "relationship_brief", data: { id: string } } }`

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| content | object | Yes | `{ type: "briefing" \| "relationship_brief", data: { id: string } }`. |

Output: Presents the widget immediately as a standalone card (returns no token).

### widget.present

Description: Present an already-created widget as a standalone chat presentation, not inline in an assistant text message. Pass a `widget_id` returned by a widget creator, or one the runtime handed to you. Do not use this for inline-only widgets such as `muse.create_options` choices or `idea.create_idea_group_widget` groups; include their returned `embed_token` in the assistant message instead. This tool does not create or update widget data.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| widget_id | string | Yes | The id of an already-created widget to present now. |

Output: Return shape not specified in schema.

### widget.state

Description: Read the durable state of a widget you already created with `widget.create_html_widget` or `widget.create_html_file_widget`. Returns `{ widget_id, kind, display_text, state, version }`. `state` is the same object the widget reads with `window.hatchWidget.getState()`, so it reflects everything the user has done by tapping the widget since you created it; `version` counts the state writes so far. Use it before answering any question about what a widget currently shows — which items are ticked, what a counter reads, what entries exist. The user may have changed the widget since you created it, so never recall widget contents from memory or from your own earlier messages. One trap on a widget nobody has tapped yet: a version-0 read returns `{}` while the widget still shows the defaults you coded at creation. Treat the empty object as "still on its seeded defaults", not as empty data.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| widget_id | string | Yes | The widget's id, e.g. widget-<uuid>: the widget_id field of a widget creator result, or the id inside a [[hatch_widget:<id>]] token you embedded in an earlier reply. |

Output: `{ widget_id, kind, display_text, state, version }`.

## worker

Schema unavailable in the compilation context. Functions are not listed.

## workflow

VM-local JavaScript workflows: orchestration code executed by the daemon that coordinates child agents. Use workflows for repeatable multi-agent automation, custom self-improvement loops, research and review sweeps, audits, migrations, verifier-gated side effects, and long-trajectory tasks where the plan should live in deterministic code instead of the parent chat context. Saved workspace workflows live in the workspace's saved-workflows directory and can be launched by name.

### workflow.create

Description: Create a new saved workflow script in the user's workspace. Saved workflows live in the workspace's saved-workflows directory and can be launched by name later with workflow.launch or workflow.launch_async. The call fails if a saved workflow with that name already exists; replace an existing one with workflow.update instead. Creating a workflow only stores the script and never runs it. Setting up a reusable workflow usually also needs workflow.launch or workflow.list.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Invocation name for the new saved workflow. Fails if a saved workflow with this name already exists. |
| script | string | Yes | Complete JavaScript workflow source to save, authored per the contract in this tool's description. |

Output: Return shape not specified in schema.

### workflow.update

Description: Replace the script of an existing saved workspace workflow. The call fails if no saved workflow with that name exists; create a new one with workflow.create instead. The new script affects only future launches by name: runs that already started keep the script snapshot they launched with. Read the current source first with workflow.view.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Invocation name of the existing saved workflow to replace. Fails if no saved workflow with this name exists. |
| script | string | Yes | Complete replacement JavaScript workflow source, authored per the contract in this tool's description. |

Output: Return shape not specified in schema.

### workflow.delete

Description: Delete one saved workflow script by its invocation name from the workspace's saved-workflows directory. The response echoes the deleted definition. Deleting a saved script never touches runs: past runs stay inspectable with workflow.view_run, and a running workflow keeps executing its own script snapshot (stop it with workflow.stop). The call fails when no saved workflow with that name exists.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Saved workspace workflow invocation name to delete. |

Output: Echoes the deleted definition.

### workflow.list

Description: List the saved workflow scripts in the user's workspace. Each entry carries the invocation name, the script's declared workflow name, description, phases, script path, script hash, and last-updated time; a script that cannot be read is listed with an error note instead of failing the whole call. Results are sorted by name and at most limit entries return (default 100, maximum 200). This lists saved scripts only: for this session's runs use workflow.list_runs, and for one script's full source use workflow.view.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| limit | integer (1-200, default 100) | No | Optional maximum saved workflows to return. |

Output: Saved workflow entries (name, declared name, description, phases, path, hash, last-updated).

### workflow.view

Description: View one saved workspace workflow script by its invocation name. Returns the script source plus its metadata: the script's declared workflow name, description, phases, script path, hash, and last-updated time. Use it to read a script before replacing it with workflow.update or launching it by name with workflow.launch. The call fails when no saved workflow with that name exists; list the available names with workflow.list.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Saved workspace workflow invocation name to view. |

Output: The script source plus metadata (declared name, description, phases, path, hash, last-updated).

### workflow.launch

Description: Launch a VM-local JavaScript workflow and wait for it to resolve. The result carries the run id, final status, and the workflow's curated final return, so use this when the caller should block on the outcome; use workflow.launch_async to return immediately instead. Provide exactly one script source: scriptPath (a workspace-contained JavaScript file, highest precedence), script (inline source), or name (a saved workspace workflow). scriptPath takes precedence over script, and script takes precedence over name. Pass structured input as the args object. A workflow session usually also needs siblings such as workflow.list, workflow.view_run, or workflow.stop.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| args | object | No | Structured input exposed verbatim to the launched workflow as the global `args`. Pass arrays and objects as JSON values, not as JSON-encoded strings. The script reads fields directly from `args`; it must not redeclare `args`. |
| name | string | No | Saved workspace workflow invocation name to launch. Used when scriptPath and script are absent. |
| resumeFromRunId | string | No | Run id of a terminal failed run to retry from. The source run must use the same root session, workspace, and workflow name; completed stable-key child results can be reused. Use workflow.resume instead when the existing run is paused. |
| script | string | No | Inline self-contained JavaScript workflow source, authored per the contract in this tool's description. Used when scriptPath is absent; takes precedence over name. |
| scriptPath | string | No | Workspace-local or absolute workspace-contained JavaScript workflow file path to launch. Takes precedence over script and name. |

Output: The run id, final status, and the workflow's curated final return.

### workflow.launch_async

Description: Launch a VM-local JavaScript workflow asynchronously and return immediately with the run id while the workflow keeps executing in the background. Follow progress with workflow.view_run and control the run with workflow.pause or workflow.stop; use workflow.launch when the caller should wait for the result instead. Provide exactly one script source: scriptPath (a workspace-contained JavaScript file, highest precedence), script (inline source), or name (a saved workspace workflow). scriptPath takes precedence over script and name. Pass structured input as the args object. An async launch usually also needs workflow.view_run and workflow.list_runs to follow the run.

Input parameters: same fields as `workflow.launch` (`args`, `name`, `resumeFromRunId`, `script`, `scriptPath`, all optional).

Output: The run id (returns immediately).

### workflow.list_runs

Description: List the workflow runs launched from this root session, with each run's id, workflow name, status, and timing. Use it to find the run id that workflow.view_run and the run control tools (workflow.pause, workflow.resume, workflow.stop, workflow.stop_agent, workflow.save_run) require. At most limit rows return. For the saved scripts rather than runs, use workflow.list.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| limit | integer | No | Optional maximum runs to return. |

Output: Runs with id, workflow name, status, and timing.

### workflow.view_run

Description: View one workflow run by run id: its status, phase progress, child agent calls with their call ids, timing, and any final result or error. Only runs belonging to this root session are visible. Use it to follow a run started with workflow.launch_async, to pick the callId that workflow.stop_agent needs, or to confirm whether a run is paused, failed, or terminal before resuming it with workflow.resume or retrying it through a new launch with resumeFromRunId. Find run ids with workflow.list_runs.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| runId | string | Yes | Workflow run id, as returned by a launch or listed by workflow.list_runs. |

Output: The run's status, phase progress, child agent calls with call ids, timing, and final result or error.

### workflow.pause

Description: Pause one workflow run by run id. Only a queued or running run changes state: pausing an already paused run is a no-op, and a terminal (succeeded, failed, stopped, or cancelled) run cannot be paused. The run keeps its progress and can continue later with workflow.resume. Only runs belonging to this root session can be controlled. To end a run permanently use workflow.stop instead.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| runId | string | Yes | Workflow run id, as returned by a launch or listed by workflow.list_runs. Only a queued or running run changes state. |

Output: Return shape not specified in schema.

### workflow.resume

Description: Resume one paused workflow run by run id. Resuming continues the same run in place; when the run was launched synchronously, this call waits for the resumed run to resolve and returns its outcome. Only a paused run that can continue without new user input qualifies. For a terminal failed run caused by a retryable provider, runtime, or other transient execution error, do not resume: launch the same workflow again with the same args and resumeFromRunId set to the failed run id (workflow.launch or workflow.launch_async). A stopped or cancelled run is terminal and must never be resumed or relaunched, and neither recovery path may be used to bypass missing input, access, approval, policy, syntax, validation, or other deterministic failures. Only runs belonging to this root session can be controlled.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| runId | string | Yes | Workflow run id, as returned by a launch or listed by workflow.list_runs. The run must be paused; a synchronous run's resume waits for it to resolve. |

Output: Resuming continues the same run in place (synchronous resume returns the outcome).

### workflow.stop

Description: Stop one workflow run by run id. Stopping is terminal: the run's remaining work is cancelled and a stopped run must never be resumed or relaunched; the resumeFromRunId retry path exists only for failed runs. Only runs belonging to this root session can be controlled. To suspend a run you intend to continue, use workflow.pause instead; to stop only one child agent while the run continues, use workflow.stop_agent.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| runId | string | Yes | Workflow run id, as returned by a launch or listed by workflow.list_runs. Stopping is terminal; a stopped run can never be resumed or relaunched. |

Output: Return shape not specified in schema.

### workflow.stop_agent

Description: Stop one child agent call inside a workflow run without stopping the run. Requires the run id and the callId of the child agent call; workflow.view_run lists the run's child calls and their call ids. The run itself keeps going; use workflow.stop to end the whole run. Only runs belonging to this root session can be controlled.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| runId | string | Yes | Workflow run id, as returned by a launch or listed by workflow.list_runs. |
| callId | string | Yes | Workflow child agent call id to stop, as listed in workflow.view_run details. |

Output: Return shape not specified in schema.

### workflow.save_run

Description: Save a workflow run's script snapshot as a saved workspace workflow, so the exact script that ran can be launched again by name later with workflow.launch or workflow.launch_async. The optional name picks the saved workflow name; when omitted, the run's own workflow name is used. Saving overwrites an existing saved workflow with the same name. The script is taken from the run's verified snapshot, not from whatever file the run was originally launched from. Only runs belonging to this root session can be controlled.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| runId | string | Yes | Workflow run id, as returned by a launch or listed by workflow.list_runs. |
| name | string | No | Optional saved workflow name for the snapshot. Defaults to the run's own workflow name; an existing saved workflow with the same name is overwritten. |

Output: Return shape not specified in schema.
