Write to a connected tool
write_to_toolChange data in a tool the person has connected to Unl — for example create or update a PostHog insight or dashboard, send a write request to a connected API, call an MCP tool that is not read-only, or create, correct or retire one of the person's own read-specs (provider 'unl', op 'amend_spec' / 'retire_spec'). Same keys as the get_from_unl tool with action='analytics': provider · op · body · target. For op 'http', body={method, path, query?, body?}; the request is signed server-side with the stored credential and sent only to the host verified when the tool was connected. Every call needs nonce: the single-use write-nonce from connect_to_unl or from the previous write, and each successful write returns the next one. A deleting or otherwise destructive request (a DELETE, POST or PATCH, a GraphQL mutation, an MCP tool with no read-only annotation, or a body touching secret-shaped fields) is first shown back exactly as it will run, with nothing sent, and a confirm token; send the same call again with confirm= to run it once. Reads are refused here and cost no nonce — use the get_from_unl tool with action='analytics' for them. This tool never writes to the substrate.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | No | the operation: http | create_insight | update_insight | create_dashboard (posthog) | amend_spec | retire_spec (unl) | <tool name> (mcp). | |
| body | No | the request: for op 'http', { method, path, query?, body? }; for a named op or an MCP tool, its payload/arguments. | |
| nonce | Yes | the single-use write-nonce from connect_to_unl or the previous write's response. May also carry the confirmation_nonce returned by a preview when an older client cannot submit a named confirmation field; this preserves every confirmation check. Expires 600 seconds after issue. For field limits and preconditions, use the get_from_unl tool with action="constraints" and q=<field name>. Prepare the payload first; after a long composition, make a successful read to obtain a fresh nonce immediately before writing. Use the newest returned nonce; never reuse it for a different write. | |
| target | No | the object or connection it applies to (e.g. an insight's numeric id, an MCP connection's name, a read-spec's read_key). | |
| confirm | No | the confirm token a destructive request returned the first time, bound to that exact request; resend the same call with it to run it. Never reuse one. | |
| provider | No | the connected tool: posthog | sentry | search_console | railway | mcp | unl | a connected tool's host. Default 'posthog'. | |
| session_token | No | THIS chat's [unl-session:] token, echoed so the connection for the project this turn was read as is the one used. | |
| analytics_name | No | legacy: a name folded into body for create ops. |