Activate a function

SDK platic.tools.functions.enable()

Set a paused function to enabled. It returns to the catalog, and connected agents can use its published version. A published version is required.

Example

await platic.tools.functions.enable("fn_123");

Path parameters

ParameterTypeDescriptionRequired
functionIdstringFunction ID✓

Request body

It has no body.

Response

data has the complete function, with the fields of Get a function.

{
  "status": "success",
  "message": "Function enabled: agents connected to it can call it",
  "data": {
    "id": "Hk2s9QmXc1",
    "name": "tax_id_lookup",
    "status": "enabled",
    "liveVersion": 2,
    "toolName": "fn_tax_id_lookup",
    "toolId": "Hk2s9QmXc1",
    "nextStep": "Live (version 2). Connect it to an agent with PUT /v1/agents/{agentId}/tools/Hk2s9QmXc1."
  }
}

Some fields are left out of the example.

Errors

Statusdetails.codeWhen
403FORBIDDEN or INSUFFICIENT_SCOPEThe credential does not have write access to Integrations
404NOT_FOUNDThe function does not exist in this workspace
409NOT_PUBLISHEDThe function has never been published. Publish it

Notes

  • Activating a function that is already on changes nothing.
  • Activating does not publish the draft. For agents to use your changes, publish.