# Tool Calls ## List objective tool calls `client.Objectives.ToolCalls.List(ctx, objectiveID, query) (*CursorPagination[ObjectiveToolCall], error)` **get** `/v1/objectives/{objectiveId}/tool_calls` Lists all tool calls for an objective ### Parameters - `objectiveID string` - `query ObjectiveToolCallListParams` - `Cursor param.Field[string]` Pagination cursor from previous response - `IncludeInfo param.Field[bool]` When set to true you may use more of your alloted API rate-limit - `Limit param.Field[int64]` Maximum number of results to return - `Status param.Field[ObjectiveToolCallListParamsStatus]` Filter by tool call status - `const ObjectiveToolCallListParamsStatusToolCallStatusUnspecified ObjectiveToolCallListParamsStatus = "TOOL_CALL_STATUS_UNSPECIFIED"` - `const ObjectiveToolCallListParamsStatusToolCallStatusAutoApproved ObjectiveToolCallListParamsStatus = "TOOL_CALL_STATUS_AUTO_APPROVED"` - `const ObjectiveToolCallListParamsStatusToolCallStatusWaitingForApproval ObjectiveToolCallListParamsStatus = "TOOL_CALL_STATUS_WAITING_FOR_APPROVAL"` - `const ObjectiveToolCallListParamsStatusToolCallStatusApproved ObjectiveToolCallListParamsStatus = "TOOL_CALL_STATUS_APPROVED"` - `const ObjectiveToolCallListParamsStatusToolCallStatusDenied ObjectiveToolCallListParamsStatus = "TOOL_CALL_STATUS_DENIED"` ### Returns - `type ObjectiveToolCall struct{…}` ObjectiveToolCall is a record of a tool call made during an objective's execution. Tool calls are mutable — their status changes as they are approved, denied, or executed. - `Data ObjectiveToolCallData` - `Callable CallableTool` CallableTool is a union that represents a tool that can be called by an agent. In Cadenya, a tool that is used within an agent objective might be a user-defined tool (IE: MCP, HTTP), another Agent (useful to separate context), or a Cadenya Tool (one Cadenya provides). - `Agent ResourceMetadata` Standard metadata for persistent, named resources (e.g., agents, tools, prompts) - `ID string` Unique identifier for the resource (prefixed ULID, e.g., "agent_01HXK...") - `AccountID string` Account this resource belongs to for multi-tenant isolation (prefixed ULID) - `CreatedAt Time` Timestamp when this resource was created - `Name string` Human-readable name for the resource (e.g., "Customer Support Agent", "Email Tool") Required for resources that users interact with directly - `ProfileID string` ID of the actor (user or service account) that created this resource - `WorkspaceID string` Workspace this resource belongs to for organizational grouping (prefixed ULID) - `ExternalID string` External ID for the resource (e.g., a workflow ID from an external system) - `Labels map[string, string]` Arbitrary key-value pairs for categorization and filtering Examples: {"environment": "production", "team": "platform", "version": "v2"} - `CadenyaProvidedTool ResourceMetadata` Standard metadata for persistent, named resources (e.g., agents, tools, prompts) - `Tool ResourceMetadata` Standard metadata for persistent, named resources (e.g., agents, tools, prompts) - `Arguments map[string, unknown]` The arguments passed to the tool - `Memo string` A memo supplied by the reviewer when denying the tool call - `Result string` The result content returned by the tool after execution - `StatusChangedBy Profile` Profile represents a human user at the account level. Profiles are account-scoped resources that can be associated with multiple workspaces through the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS). - `Metadata AccountResourceMetadata` AccountResourceMetadata is used to represent a resource that is associated to an account but not to a workspace. - `ID string` Unique identifier for the resource (prefixed ULID, e.g., "apikey_01HXK...") - `AccountID string` Account this resource belongs to for multi-tenant isolation (prefixed ULID) - `Name string` Human-readable name for the resource (e.g., "Customer Support Agent", "Email Tool") Required for resources that users interact with directly - `ProfileID string` - `ExternalID string` External ID for the resource (e.g., a workflow ID from an external system) - `Labels map[string, string]` Arbitrary key-value pairs for categorization and filtering Examples: {"environment": "production", "team": "platform", "version": "v2"} - `Spec ProfileSpec` ProfileSpec contains the profile-specific fields - `Type ProfileSpecType` Type is the type of profile. User's are humans, API keys are computers. You know the deal. - `const ProfileSpecTypeProfileTypeUser ProfileSpecType = "PROFILE_TYPE_USER"` - `const ProfileSpecTypeProfileTypeAPIKey ProfileSpecType = "PROFILE_TYPE_API_KEY"` - `const ProfileSpecTypeProfileTypeSystem ProfileSpecType = "PROFILE_TYPE_SYSTEM"` - `Email string` Email address of the user (required, unique per account) - `Name string` Display name for the user (e.g., "Bobby Tables") - `Metadata OperationMetadata` Metadata for ephemeral operations and activities (e.g., objectives, executions, runs) - `ID string` Unique identifier for the operation (prefixed ULID, e.g., "obj_01HXK...") - `AccountID string` Account this operation belongs to for multi-tenant isolation (prefixed ULID) - `CreatedAt Time` Timestamp when this operation was created ULID includes timestamp information, but this explicit field enables easier querying - `ProfileID string` ID of the actor (user or service account) that created this operation - `WorkspaceID string` Workspace this operation belongs to for organizational grouping (prefixed ULID) - `ExternalID string` External ID for the operation (e.g., a workflow ID from an external system) - `Labels map[string, string]` Arbitrary key-value pairs for categorization and filtering Examples: {"priority": "high", "source": "api", "workflow": "onboarding"} - `Status ObjectiveToolCallStatus` Current status of the tool call - `const ObjectiveToolCallStatusToolCallStatusUnspecified ObjectiveToolCallStatus = "TOOL_CALL_STATUS_UNSPECIFIED"` - `const ObjectiveToolCallStatusToolCallStatusAutoApproved ObjectiveToolCallStatus = "TOOL_CALL_STATUS_AUTO_APPROVED"` - `const ObjectiveToolCallStatusToolCallStatusWaitingForApproval ObjectiveToolCallStatus = "TOOL_CALL_STATUS_WAITING_FOR_APPROVAL"` - `const ObjectiveToolCallStatusToolCallStatusApproved ObjectiveToolCallStatus = "TOOL_CALL_STATUS_APPROVED"` - `const ObjectiveToolCallStatusToolCallStatusDenied ObjectiveToolCallStatus = "TOOL_CALL_STATUS_DENIED"` - `ExecutionStatus ObjectiveToolCallExecutionStatus` - `const ObjectiveToolCallExecutionStatusToolCallExecutionStatusUnspecified ObjectiveToolCallExecutionStatus = "TOOL_CALL_EXECUTION_STATUS_UNSPECIFIED"` - `const ObjectiveToolCallExecutionStatusToolCallExecutionStatusPending ObjectiveToolCallExecutionStatus = "TOOL_CALL_EXECUTION_STATUS_PENDING"` - `const ObjectiveToolCallExecutionStatusToolCallExecutionStatusRunning ObjectiveToolCallExecutionStatus = "TOOL_CALL_EXECUTION_STATUS_RUNNING"` - `const ObjectiveToolCallExecutionStatusToolCallExecutionStatusCompleted ObjectiveToolCallExecutionStatus = "TOOL_CALL_EXECUTION_STATUS_COMPLETED"` - `const ObjectiveToolCallExecutionStatusToolCallExecutionStatusErrored ObjectiveToolCallExecutionStatus = "TOOL_CALL_EXECUTION_STATUS_ERRORED"` - `Info ObjectiveToolCallInfo` - `CreatedBy Profile` Profile represents a human user at the account level. Profiles are account-scoped resources that can be associated with multiple workspaces through the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS). - `Objective OperationMetadata` Metadata for ephemeral operations and activities (e.g., objectives, executions, runs) ### Example ```go package main import ( "context" "fmt" "github.com/cadenya/cadenya-go" "github.com/cadenya/cadenya-go/option" ) func main() { client := cadenya.NewClient( option.WithAPIKey("My API Key"), ) page, err := client.Objectives.ToolCalls.List( context.TODO(), "objectiveId", cadenya.ObjectiveToolCallListParams{ }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "items": [ { "data": { "callable": { "agent": { "id": "id", "accountId": "accountId", "createdAt": "2019-12-27T18:11:19.117Z", "name": "name", "profileId": "profileId", "workspaceId": "workspaceId", "externalId": "externalId", "labels": { "foo": "string" } }, "cadenyaProvidedTool": { "id": "id", "accountId": "accountId", "createdAt": "2019-12-27T18:11:19.117Z", "name": "name", "profileId": "profileId", "workspaceId": "workspaceId", "externalId": "externalId", "labels": { "foo": "string" } }, "tool": { "id": "id", "accountId": "accountId", "createdAt": "2019-12-27T18:11:19.117Z", "name": "name", "profileId": "profileId", "workspaceId": "workspaceId", "externalId": "externalId", "labels": { "foo": "string" } } }, "arguments": { "foo": "bar" }, "memo": "memo", "result": "result", "statusChangedBy": { "metadata": { "id": "id", "accountId": "accountId", "name": "name", "profileId": "profileId", "externalId": "externalId", "labels": { "foo": "string" } }, "spec": { "type": "PROFILE_TYPE_USER", "email": "email", "name": "name" } } }, "metadata": { "id": "id", "accountId": "accountId", "createdAt": "2019-12-27T18:11:19.117Z", "profileId": "profileId", "workspaceId": "workspaceId", "externalId": "externalId", "labels": { "foo": "string" } }, "status": "TOOL_CALL_STATUS_UNSPECIFIED", "executionStatus": "TOOL_CALL_EXECUTION_STATUS_UNSPECIFIED", "info": { "createdBy": { "metadata": { "id": "id", "accountId": "accountId", "name": "name", "profileId": "profileId", "externalId": "externalId", "labels": { "foo": "string" } }, "spec": { "type": "PROFILE_TYPE_USER", "email": "email", "name": "name" } }, "objective": { "id": "id", "accountId": "accountId", "createdAt": "2019-12-27T18:11:19.117Z", "profileId": "profileId", "workspaceId": "workspaceId", "externalId": "externalId", "labels": { "foo": "string" } } } } ], "pagination": { "nextCursor": "nextCursor", "total": 0 } } ``` ## Approve a tool call `client.Objectives.ToolCalls.Approve(ctx, objectiveID, toolCallID, body) (*ObjectiveToolCall, error)` **put** `/v1/objectives/{objectiveId}/tool_calls/{toolCallId}/approve` When an agent attempts to use a tool that requires approval, use this endpoint to mark it as approved. ### Parameters - `objectiveID string` - `toolCallID string` - `body ObjectiveToolCallApproveParams` ### Returns - `type ObjectiveToolCall struct{…}` ObjectiveToolCall is a record of a tool call made during an objective's execution. Tool calls are mutable — their status changes as they are approved, denied, or executed. - `Data ObjectiveToolCallData` - `Callable CallableTool` CallableTool is a union that represents a tool that can be called by an agent. In Cadenya, a tool that is used within an agent objective might be a user-defined tool (IE: MCP, HTTP), another Agent (useful to separate context), or a Cadenya Tool (one Cadenya provides). - `Agent ResourceMetadata` Standard metadata for persistent, named resources (e.g., agents, tools, prompts) - `ID string` Unique identifier for the resource (prefixed ULID, e.g., "agent_01HXK...") - `AccountID string` Account this resource belongs to for multi-tenant isolation (prefixed ULID) - `CreatedAt Time` Timestamp when this resource was created - `Name string` Human-readable name for the resource (e.g., "Customer Support Agent", "Email Tool") Required for resources that users interact with directly - `ProfileID string` ID of the actor (user or service account) that created this resource - `WorkspaceID string` Workspace this resource belongs to for organizational grouping (prefixed ULID) - `ExternalID string` External ID for the resource (e.g., a workflow ID from an external system) - `Labels map[string, string]` Arbitrary key-value pairs for categorization and filtering Examples: {"environment": "production", "team": "platform", "version": "v2"} - `CadenyaProvidedTool ResourceMetadata` Standard metadata for persistent, named resources (e.g., agents, tools, prompts) - `Tool ResourceMetadata` Standard metadata for persistent, named resources (e.g., agents, tools, prompts) - `Arguments map[string, unknown]` The arguments passed to the tool - `Memo string` A memo supplied by the reviewer when denying the tool call - `Result string` The result content returned by the tool after execution - `StatusChangedBy Profile` Profile represents a human user at the account level. Profiles are account-scoped resources that can be associated with multiple workspaces through the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS). - `Metadata AccountResourceMetadata` AccountResourceMetadata is used to represent a resource that is associated to an account but not to a workspace. - `ID string` Unique identifier for the resource (prefixed ULID, e.g., "apikey_01HXK...") - `AccountID string` Account this resource belongs to for multi-tenant isolation (prefixed ULID) - `Name string` Human-readable name for the resource (e.g., "Customer Support Agent", "Email Tool") Required for resources that users interact with directly - `ProfileID string` - `ExternalID string` External ID for the resource (e.g., a workflow ID from an external system) - `Labels map[string, string]` Arbitrary key-value pairs for categorization and filtering Examples: {"environment": "production", "team": "platform", "version": "v2"} - `Spec ProfileSpec` ProfileSpec contains the profile-specific fields - `Type ProfileSpecType` Type is the type of profile. User's are humans, API keys are computers. You know the deal. - `const ProfileSpecTypeProfileTypeUser ProfileSpecType = "PROFILE_TYPE_USER"` - `const ProfileSpecTypeProfileTypeAPIKey ProfileSpecType = "PROFILE_TYPE_API_KEY"` - `const ProfileSpecTypeProfileTypeSystem ProfileSpecType = "PROFILE_TYPE_SYSTEM"` - `Email string` Email address of the user (required, unique per account) - `Name string` Display name for the user (e.g., "Bobby Tables") - `Metadata OperationMetadata` Metadata for ephemeral operations and activities (e.g., objectives, executions, runs) - `ID string` Unique identifier for the operation (prefixed ULID, e.g., "obj_01HXK...") - `AccountID string` Account this operation belongs to for multi-tenant isolation (prefixed ULID) - `CreatedAt Time` Timestamp when this operation was created ULID includes timestamp information, but this explicit field enables easier querying - `ProfileID string` ID of the actor (user or service account) that created this operation - `WorkspaceID string` Workspace this operation belongs to for organizational grouping (prefixed ULID) - `ExternalID string` External ID for the operation (e.g., a workflow ID from an external system) - `Labels map[string, string]` Arbitrary key-value pairs for categorization and filtering Examples: {"priority": "high", "source": "api", "workflow": "onboarding"} - `Status ObjectiveToolCallStatus` Current status of the tool call - `const ObjectiveToolCallStatusToolCallStatusUnspecified ObjectiveToolCallStatus = "TOOL_CALL_STATUS_UNSPECIFIED"` - `const ObjectiveToolCallStatusToolCallStatusAutoApproved ObjectiveToolCallStatus = "TOOL_CALL_STATUS_AUTO_APPROVED"` - `const ObjectiveToolCallStatusToolCallStatusWaitingForApproval ObjectiveToolCallStatus = "TOOL_CALL_STATUS_WAITING_FOR_APPROVAL"` - `const ObjectiveToolCallStatusToolCallStatusApproved ObjectiveToolCallStatus = "TOOL_CALL_STATUS_APPROVED"` - `const ObjectiveToolCallStatusToolCallStatusDenied ObjectiveToolCallStatus = "TOOL_CALL_STATUS_DENIED"` - `ExecutionStatus ObjectiveToolCallExecutionStatus` - `const ObjectiveToolCallExecutionStatusToolCallExecutionStatusUnspecified ObjectiveToolCallExecutionStatus = "TOOL_CALL_EXECUTION_STATUS_UNSPECIFIED"` - `const ObjectiveToolCallExecutionStatusToolCallExecutionStatusPending ObjectiveToolCallExecutionStatus = "TOOL_CALL_EXECUTION_STATUS_PENDING"` - `const ObjectiveToolCallExecutionStatusToolCallExecutionStatusRunning ObjectiveToolCallExecutionStatus = "TOOL_CALL_EXECUTION_STATUS_RUNNING"` - `const ObjectiveToolCallExecutionStatusToolCallExecutionStatusCompleted ObjectiveToolCallExecutionStatus = "TOOL_CALL_EXECUTION_STATUS_COMPLETED"` - `const ObjectiveToolCallExecutionStatusToolCallExecutionStatusErrored ObjectiveToolCallExecutionStatus = "TOOL_CALL_EXECUTION_STATUS_ERRORED"` - `Info ObjectiveToolCallInfo` - `CreatedBy Profile` Profile represents a human user at the account level. Profiles are account-scoped resources that can be associated with multiple workspaces through the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS). - `Objective OperationMetadata` Metadata for ephemeral operations and activities (e.g., objectives, executions, runs) ### Example ```go package main import ( "context" "fmt" "github.com/cadenya/cadenya-go" "github.com/cadenya/cadenya-go/option" ) func main() { client := cadenya.NewClient( option.WithAPIKey("My API Key"), ) objectiveToolCall, err := client.Objectives.ToolCalls.Approve( context.TODO(), "objectiveId", "toolCallId", cadenya.ObjectiveToolCallApproveParams{ }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", objectiveToolCall.Data) } ``` #### Response ```json { "data": { "callable": { "agent": { "id": "id", "accountId": "accountId", "createdAt": "2019-12-27T18:11:19.117Z", "name": "name", "profileId": "profileId", "workspaceId": "workspaceId", "externalId": "externalId", "labels": { "foo": "string" } }, "cadenyaProvidedTool": { "id": "id", "accountId": "accountId", "createdAt": "2019-12-27T18:11:19.117Z", "name": "name", "profileId": "profileId", "workspaceId": "workspaceId", "externalId": "externalId", "labels": { "foo": "string" } }, "tool": { "id": "id", "accountId": "accountId", "createdAt": "2019-12-27T18:11:19.117Z", "name": "name", "profileId": "profileId", "workspaceId": "workspaceId", "externalId": "externalId", "labels": { "foo": "string" } } }, "arguments": { "foo": "bar" }, "memo": "memo", "result": "result", "statusChangedBy": { "metadata": { "id": "id", "accountId": "accountId", "name": "name", "profileId": "profileId", "externalId": "externalId", "labels": { "foo": "string" } }, "spec": { "type": "PROFILE_TYPE_USER", "email": "email", "name": "name" } } }, "metadata": { "id": "id", "accountId": "accountId", "createdAt": "2019-12-27T18:11:19.117Z", "profileId": "profileId", "workspaceId": "workspaceId", "externalId": "externalId", "labels": { "foo": "string" } }, "status": "TOOL_CALL_STATUS_UNSPECIFIED", "executionStatus": "TOOL_CALL_EXECUTION_STATUS_UNSPECIFIED", "info": { "createdBy": { "metadata": { "id": "id", "accountId": "accountId", "name": "name", "profileId": "profileId", "externalId": "externalId", "labels": { "foo": "string" } }, "spec": { "type": "PROFILE_TYPE_USER", "email": "email", "name": "name" } }, "objective": { "id": "id", "accountId": "accountId", "createdAt": "2019-12-27T18:11:19.117Z", "profileId": "profileId", "workspaceId": "workspaceId", "externalId": "externalId", "labels": { "foo": "string" } } } } ``` ## Deny a tool call `client.Objectives.ToolCalls.Deny(ctx, objectiveID, toolCallID, body) (*ObjectiveToolCall, error)` **put** `/v1/objectives/{objectiveId}/tool_calls/{toolCallId}/deny` When an agent attempts to use a tool that requires approval, use this endpoint to mark it as denied. Use a memo to steer the LLM to a different decision or usage of the tool. ### Parameters - `objectiveID string` - `toolCallID string` - `body ObjectiveToolCallDenyParams` - `Memo param.Field[string]` A memo to associate to the tool call denial. Use a memo to steer the LLM to a different decision or usage of the tool. ### Returns - `type ObjectiveToolCall struct{…}` ObjectiveToolCall is a record of a tool call made during an objective's execution. Tool calls are mutable — their status changes as they are approved, denied, or executed. - `Data ObjectiveToolCallData` - `Callable CallableTool` CallableTool is a union that represents a tool that can be called by an agent. In Cadenya, a tool that is used within an agent objective might be a user-defined tool (IE: MCP, HTTP), another Agent (useful to separate context), or a Cadenya Tool (one Cadenya provides). - `Agent ResourceMetadata` Standard metadata for persistent, named resources (e.g., agents, tools, prompts) - `ID string` Unique identifier for the resource (prefixed ULID, e.g., "agent_01HXK...") - `AccountID string` Account this resource belongs to for multi-tenant isolation (prefixed ULID) - `CreatedAt Time` Timestamp when this resource was created - `Name string` Human-readable name for the resource (e.g., "Customer Support Agent", "Email Tool") Required for resources that users interact with directly - `ProfileID string` ID of the actor (user or service account) that created this resource - `WorkspaceID string` Workspace this resource belongs to for organizational grouping (prefixed ULID) - `ExternalID string` External ID for the resource (e.g., a workflow ID from an external system) - `Labels map[string, string]` Arbitrary key-value pairs for categorization and filtering Examples: {"environment": "production", "team": "platform", "version": "v2"} - `CadenyaProvidedTool ResourceMetadata` Standard metadata for persistent, named resources (e.g., agents, tools, prompts) - `Tool ResourceMetadata` Standard metadata for persistent, named resources (e.g., agents, tools, prompts) - `Arguments map[string, unknown]` The arguments passed to the tool - `Memo string` A memo supplied by the reviewer when denying the tool call - `Result string` The result content returned by the tool after execution - `StatusChangedBy Profile` Profile represents a human user at the account level. Profiles are account-scoped resources that can be associated with multiple workspaces through the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS). - `Metadata AccountResourceMetadata` AccountResourceMetadata is used to represent a resource that is associated to an account but not to a workspace. - `ID string` Unique identifier for the resource (prefixed ULID, e.g., "apikey_01HXK...") - `AccountID string` Account this resource belongs to for multi-tenant isolation (prefixed ULID) - `Name string` Human-readable name for the resource (e.g., "Customer Support Agent", "Email Tool") Required for resources that users interact with directly - `ProfileID string` - `ExternalID string` External ID for the resource (e.g., a workflow ID from an external system) - `Labels map[string, string]` Arbitrary key-value pairs for categorization and filtering Examples: {"environment": "production", "team": "platform", "version": "v2"} - `Spec ProfileSpec` ProfileSpec contains the profile-specific fields - `Type ProfileSpecType` Type is the type of profile. User's are humans, API keys are computers. You know the deal. - `const ProfileSpecTypeProfileTypeUser ProfileSpecType = "PROFILE_TYPE_USER"` - `const ProfileSpecTypeProfileTypeAPIKey ProfileSpecType = "PROFILE_TYPE_API_KEY"` - `const ProfileSpecTypeProfileTypeSystem ProfileSpecType = "PROFILE_TYPE_SYSTEM"` - `Email string` Email address of the user (required, unique per account) - `Name string` Display name for the user (e.g., "Bobby Tables") - `Metadata OperationMetadata` Metadata for ephemeral operations and activities (e.g., objectives, executions, runs) - `ID string` Unique identifier for the operation (prefixed ULID, e.g., "obj_01HXK...") - `AccountID string` Account this operation belongs to for multi-tenant isolation (prefixed ULID) - `CreatedAt Time` Timestamp when this operation was created ULID includes timestamp information, but this explicit field enables easier querying - `ProfileID string` ID of the actor (user or service account) that created this operation - `WorkspaceID string` Workspace this operation belongs to for organizational grouping (prefixed ULID) - `ExternalID string` External ID for the operation (e.g., a workflow ID from an external system) - `Labels map[string, string]` Arbitrary key-value pairs for categorization and filtering Examples: {"priority": "high", "source": "api", "workflow": "onboarding"} - `Status ObjectiveToolCallStatus` Current status of the tool call - `const ObjectiveToolCallStatusToolCallStatusUnspecified ObjectiveToolCallStatus = "TOOL_CALL_STATUS_UNSPECIFIED"` - `const ObjectiveToolCallStatusToolCallStatusAutoApproved ObjectiveToolCallStatus = "TOOL_CALL_STATUS_AUTO_APPROVED"` - `const ObjectiveToolCallStatusToolCallStatusWaitingForApproval ObjectiveToolCallStatus = "TOOL_CALL_STATUS_WAITING_FOR_APPROVAL"` - `const ObjectiveToolCallStatusToolCallStatusApproved ObjectiveToolCallStatus = "TOOL_CALL_STATUS_APPROVED"` - `const ObjectiveToolCallStatusToolCallStatusDenied ObjectiveToolCallStatus = "TOOL_CALL_STATUS_DENIED"` - `ExecutionStatus ObjectiveToolCallExecutionStatus` - `const ObjectiveToolCallExecutionStatusToolCallExecutionStatusUnspecified ObjectiveToolCallExecutionStatus = "TOOL_CALL_EXECUTION_STATUS_UNSPECIFIED"` - `const ObjectiveToolCallExecutionStatusToolCallExecutionStatusPending ObjectiveToolCallExecutionStatus = "TOOL_CALL_EXECUTION_STATUS_PENDING"` - `const ObjectiveToolCallExecutionStatusToolCallExecutionStatusRunning ObjectiveToolCallExecutionStatus = "TOOL_CALL_EXECUTION_STATUS_RUNNING"` - `const ObjectiveToolCallExecutionStatusToolCallExecutionStatusCompleted ObjectiveToolCallExecutionStatus = "TOOL_CALL_EXECUTION_STATUS_COMPLETED"` - `const ObjectiveToolCallExecutionStatusToolCallExecutionStatusErrored ObjectiveToolCallExecutionStatus = "TOOL_CALL_EXECUTION_STATUS_ERRORED"` - `Info ObjectiveToolCallInfo` - `CreatedBy Profile` Profile represents a human user at the account level. Profiles are account-scoped resources that can be associated with multiple workspaces through the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS). - `Objective OperationMetadata` Metadata for ephemeral operations and activities (e.g., objectives, executions, runs) ### Example ```go package main import ( "context" "fmt" "github.com/cadenya/cadenya-go" "github.com/cadenya/cadenya-go/option" ) func main() { client := cadenya.NewClient( option.WithAPIKey("My API Key"), ) objectiveToolCall, err := client.Objectives.ToolCalls.Deny( context.TODO(), "objectiveId", "toolCallId", cadenya.ObjectiveToolCallDenyParams{ }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", objectiveToolCall.Data) } ``` #### Response ```json { "data": { "callable": { "agent": { "id": "id", "accountId": "accountId", "createdAt": "2019-12-27T18:11:19.117Z", "name": "name", "profileId": "profileId", "workspaceId": "workspaceId", "externalId": "externalId", "labels": { "foo": "string" } }, "cadenyaProvidedTool": { "id": "id", "accountId": "accountId", "createdAt": "2019-12-27T18:11:19.117Z", "name": "name", "profileId": "profileId", "workspaceId": "workspaceId", "externalId": "externalId", "labels": { "foo": "string" } }, "tool": { "id": "id", "accountId": "accountId", "createdAt": "2019-12-27T18:11:19.117Z", "name": "name", "profileId": "profileId", "workspaceId": "workspaceId", "externalId": "externalId", "labels": { "foo": "string" } } }, "arguments": { "foo": "bar" }, "memo": "memo", "result": "result", "statusChangedBy": { "metadata": { "id": "id", "accountId": "accountId", "name": "name", "profileId": "profileId", "externalId": "externalId", "labels": { "foo": "string" } }, "spec": { "type": "PROFILE_TYPE_USER", "email": "email", "name": "name" } } }, "metadata": { "id": "id", "accountId": "accountId", "createdAt": "2019-12-27T18:11:19.117Z", "profileId": "profileId", "workspaceId": "workspaceId", "externalId": "externalId", "labels": { "foo": "string" } }, "status": "TOOL_CALL_STATUS_UNSPECIFIED", "executionStatus": "TOOL_CALL_EXECUTION_STATUS_UNSPECIFIED", "info": { "createdBy": { "metadata": { "id": "id", "accountId": "accountId", "name": "name", "profileId": "profileId", "externalId": "externalId", "labels": { "foo": "string" } }, "spec": { "type": "PROFILE_TYPE_USER", "email": "email", "name": "name" } }, "objective": { "id": "id", "accountId": "accountId", "createdAt": "2019-12-27T18:11:19.117Z", "profileId": "profileId", "workspaceId": "workspaceId", "externalId": "externalId", "labels": { "foo": "string" } } } } ``` ## Domain Types ### Objective Tool Call - `type ObjectiveToolCall struct{…}` ObjectiveToolCall is a record of a tool call made during an objective's execution. Tool calls are mutable — their status changes as they are approved, denied, or executed. - `Data ObjectiveToolCallData` - `Callable CallableTool` CallableTool is a union that represents a tool that can be called by an agent. In Cadenya, a tool that is used within an agent objective might be a user-defined tool (IE: MCP, HTTP), another Agent (useful to separate context), or a Cadenya Tool (one Cadenya provides). - `Agent ResourceMetadata` Standard metadata for persistent, named resources (e.g., agents, tools, prompts) - `ID string` Unique identifier for the resource (prefixed ULID, e.g., "agent_01HXK...") - `AccountID string` Account this resource belongs to for multi-tenant isolation (prefixed ULID) - `CreatedAt Time` Timestamp when this resource was created - `Name string` Human-readable name for the resource (e.g., "Customer Support Agent", "Email Tool") Required for resources that users interact with directly - `ProfileID string` ID of the actor (user or service account) that created this resource - `WorkspaceID string` Workspace this resource belongs to for organizational grouping (prefixed ULID) - `ExternalID string` External ID for the resource (e.g., a workflow ID from an external system) - `Labels map[string, string]` Arbitrary key-value pairs for categorization and filtering Examples: {"environment": "production", "team": "platform", "version": "v2"} - `CadenyaProvidedTool ResourceMetadata` Standard metadata for persistent, named resources (e.g., agents, tools, prompts) - `Tool ResourceMetadata` Standard metadata for persistent, named resources (e.g., agents, tools, prompts) - `Arguments map[string, unknown]` The arguments passed to the tool - `Memo string` A memo supplied by the reviewer when denying the tool call - `Result string` The result content returned by the tool after execution - `StatusChangedBy Profile` Profile represents a human user at the account level. Profiles are account-scoped resources that can be associated with multiple workspaces through the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS). - `Metadata AccountResourceMetadata` AccountResourceMetadata is used to represent a resource that is associated to an account but not to a workspace. - `ID string` Unique identifier for the resource (prefixed ULID, e.g., "apikey_01HXK...") - `AccountID string` Account this resource belongs to for multi-tenant isolation (prefixed ULID) - `Name string` Human-readable name for the resource (e.g., "Customer Support Agent", "Email Tool") Required for resources that users interact with directly - `ProfileID string` - `ExternalID string` External ID for the resource (e.g., a workflow ID from an external system) - `Labels map[string, string]` Arbitrary key-value pairs for categorization and filtering Examples: {"environment": "production", "team": "platform", "version": "v2"} - `Spec ProfileSpec` ProfileSpec contains the profile-specific fields - `Type ProfileSpecType` Type is the type of profile. User's are humans, API keys are computers. You know the deal. - `const ProfileSpecTypeProfileTypeUser ProfileSpecType = "PROFILE_TYPE_USER"` - `const ProfileSpecTypeProfileTypeAPIKey ProfileSpecType = "PROFILE_TYPE_API_KEY"` - `const ProfileSpecTypeProfileTypeSystem ProfileSpecType = "PROFILE_TYPE_SYSTEM"` - `Email string` Email address of the user (required, unique per account) - `Name string` Display name for the user (e.g., "Bobby Tables") - `Metadata OperationMetadata` Metadata for ephemeral operations and activities (e.g., objectives, executions, runs) - `ID string` Unique identifier for the operation (prefixed ULID, e.g., "obj_01HXK...") - `AccountID string` Account this operation belongs to for multi-tenant isolation (prefixed ULID) - `CreatedAt Time` Timestamp when this operation was created ULID includes timestamp information, but this explicit field enables easier querying - `ProfileID string` ID of the actor (user or service account) that created this operation - `WorkspaceID string` Workspace this operation belongs to for organizational grouping (prefixed ULID) - `ExternalID string` External ID for the operation (e.g., a workflow ID from an external system) - `Labels map[string, string]` Arbitrary key-value pairs for categorization and filtering Examples: {"priority": "high", "source": "api", "workflow": "onboarding"} - `Status ObjectiveToolCallStatus` Current status of the tool call - `const ObjectiveToolCallStatusToolCallStatusUnspecified ObjectiveToolCallStatus = "TOOL_CALL_STATUS_UNSPECIFIED"` - `const ObjectiveToolCallStatusToolCallStatusAutoApproved ObjectiveToolCallStatus = "TOOL_CALL_STATUS_AUTO_APPROVED"` - `const ObjectiveToolCallStatusToolCallStatusWaitingForApproval ObjectiveToolCallStatus = "TOOL_CALL_STATUS_WAITING_FOR_APPROVAL"` - `const ObjectiveToolCallStatusToolCallStatusApproved ObjectiveToolCallStatus = "TOOL_CALL_STATUS_APPROVED"` - `const ObjectiveToolCallStatusToolCallStatusDenied ObjectiveToolCallStatus = "TOOL_CALL_STATUS_DENIED"` - `ExecutionStatus ObjectiveToolCallExecutionStatus` - `const ObjectiveToolCallExecutionStatusToolCallExecutionStatusUnspecified ObjectiveToolCallExecutionStatus = "TOOL_CALL_EXECUTION_STATUS_UNSPECIFIED"` - `const ObjectiveToolCallExecutionStatusToolCallExecutionStatusPending ObjectiveToolCallExecutionStatus = "TOOL_CALL_EXECUTION_STATUS_PENDING"` - `const ObjectiveToolCallExecutionStatusToolCallExecutionStatusRunning ObjectiveToolCallExecutionStatus = "TOOL_CALL_EXECUTION_STATUS_RUNNING"` - `const ObjectiveToolCallExecutionStatusToolCallExecutionStatusCompleted ObjectiveToolCallExecutionStatus = "TOOL_CALL_EXECUTION_STATUS_COMPLETED"` - `const ObjectiveToolCallExecutionStatusToolCallExecutionStatusErrored ObjectiveToolCallExecutionStatus = "TOOL_CALL_EXECUTION_STATUS_ERRORED"` - `Info ObjectiveToolCallInfo` - `CreatedBy Profile` Profile represents a human user at the account level. Profiles are account-scoped resources that can be associated with multiple workspaces through the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS). - `Objective OperationMetadata` Metadata for ephemeral operations and activities (e.g., objectives, executions, runs) ### Objective Tool Call Data - `type ObjectiveToolCallData struct{…}` - `Callable CallableTool` CallableTool is a union that represents a tool that can be called by an agent. In Cadenya, a tool that is used within an agent objective might be a user-defined tool (IE: MCP, HTTP), another Agent (useful to separate context), or a Cadenya Tool (one Cadenya provides). - `Agent ResourceMetadata` Standard metadata for persistent, named resources (e.g., agents, tools, prompts) - `ID string` Unique identifier for the resource (prefixed ULID, e.g., "agent_01HXK...") - `AccountID string` Account this resource belongs to for multi-tenant isolation (prefixed ULID) - `CreatedAt Time` Timestamp when this resource was created - `Name string` Human-readable name for the resource (e.g., "Customer Support Agent", "Email Tool") Required for resources that users interact with directly - `ProfileID string` ID of the actor (user or service account) that created this resource - `WorkspaceID string` Workspace this resource belongs to for organizational grouping (prefixed ULID) - `ExternalID string` External ID for the resource (e.g., a workflow ID from an external system) - `Labels map[string, string]` Arbitrary key-value pairs for categorization and filtering Examples: {"environment": "production", "team": "platform", "version": "v2"} - `CadenyaProvidedTool ResourceMetadata` Standard metadata for persistent, named resources (e.g., agents, tools, prompts) - `Tool ResourceMetadata` Standard metadata for persistent, named resources (e.g., agents, tools, prompts) - `Arguments map[string, unknown]` The arguments passed to the tool - `Memo string` A memo supplied by the reviewer when denying the tool call - `Result string` The result content returned by the tool after execution - `StatusChangedBy Profile` Profile represents a human user at the account level. Profiles are account-scoped resources that can be associated with multiple workspaces through the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS). - `Metadata AccountResourceMetadata` AccountResourceMetadata is used to represent a resource that is associated to an account but not to a workspace. - `ID string` Unique identifier for the resource (prefixed ULID, e.g., "apikey_01HXK...") - `AccountID string` Account this resource belongs to for multi-tenant isolation (prefixed ULID) - `Name string` Human-readable name for the resource (e.g., "Customer Support Agent", "Email Tool") Required for resources that users interact with directly - `ProfileID string` - `ExternalID string` External ID for the resource (e.g., a workflow ID from an external system) - `Labels map[string, string]` Arbitrary key-value pairs for categorization and filtering Examples: {"environment": "production", "team": "platform", "version": "v2"} - `Spec ProfileSpec` ProfileSpec contains the profile-specific fields - `Type ProfileSpecType` Type is the type of profile. User's are humans, API keys are computers. You know the deal. - `const ProfileSpecTypeProfileTypeUser ProfileSpecType = "PROFILE_TYPE_USER"` - `const ProfileSpecTypeProfileTypeAPIKey ProfileSpecType = "PROFILE_TYPE_API_KEY"` - `const ProfileSpecTypeProfileTypeSystem ProfileSpecType = "PROFILE_TYPE_SYSTEM"` - `Email string` Email address of the user (required, unique per account) - `Name string` Display name for the user (e.g., "Bobby Tables") ### Objective Tool Call Info - `type ObjectiveToolCallInfo struct{…}` - `CreatedBy Profile` Profile represents a human user at the account level. Profiles are account-scoped resources that can be associated with multiple workspaces through the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS). - `Metadata AccountResourceMetadata` AccountResourceMetadata is used to represent a resource that is associated to an account but not to a workspace. - `ID string` Unique identifier for the resource (prefixed ULID, e.g., "apikey_01HXK...") - `AccountID string` Account this resource belongs to for multi-tenant isolation (prefixed ULID) - `Name string` Human-readable name for the resource (e.g., "Customer Support Agent", "Email Tool") Required for resources that users interact with directly - `ProfileID string` - `ExternalID string` External ID for the resource (e.g., a workflow ID from an external system) - `Labels map[string, string]` Arbitrary key-value pairs for categorization and filtering Examples: {"environment": "production", "team": "platform", "version": "v2"} - `Spec ProfileSpec` ProfileSpec contains the profile-specific fields - `Type ProfileSpecType` Type is the type of profile. User's are humans, API keys are computers. You know the deal. - `const ProfileSpecTypeProfileTypeUser ProfileSpecType = "PROFILE_TYPE_USER"` - `const ProfileSpecTypeProfileTypeAPIKey ProfileSpecType = "PROFILE_TYPE_API_KEY"` - `const ProfileSpecTypeProfileTypeSystem ProfileSpecType = "PROFILE_TYPE_SYSTEM"` - `Email string` Email address of the user (required, unique per account) - `Name string` Display name for the user (e.g., "Bobby Tables") - `Objective OperationMetadata` Metadata for ephemeral operations and activities (e.g., objectives, executions, runs) - `ID string` Unique identifier for the operation (prefixed ULID, e.g., "obj_01HXK...") - `AccountID string` Account this operation belongs to for multi-tenant isolation (prefixed ULID) - `CreatedAt Time` Timestamp when this operation was created ULID includes timestamp information, but this explicit field enables easier querying - `ProfileID string` ID of the actor (user or service account) that created this operation - `WorkspaceID string` Workspace this operation belongs to for organizational grouping (prefixed ULID) - `ExternalID string` External ID for the operation (e.g., a workflow ID from an external system) - `Labels map[string, string]` Arbitrary key-value pairs for categorization and filtering Examples: {"priority": "high", "source": "api", "workflow": "onboarding"}