Get a tool by ID
client.ToolSets.Tools.Get(ctx, toolSetID, id) (*Tool, error)
GET/v1/tool_sets/{toolSetId}/tools/{id}
Get a tool by ID
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"),
)
tool, err := client.ToolSets.Tools.Get(
context.TODO(),
"toolSetId",
"id",
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", tool.Metadata)
}
{
"metadata": {
"id": "id",
"accountId": "accountId",
"createdAt": "2019-12-27T18:11:19.117Z",
"name": "name",
"profileId": "profileId",
"workspaceId": "workspaceId",
"externalId": "externalId",
"labels": {
"foo": "string"
}
},
"spec": {
"config": {
"http": {
"requestMethod": "GET",
"headers": {
"foo": "string"
},
"path": "path",
"query": "query",
"requestBodyContentType": "requestBodyContentType",
"requestBodyTemplate": "requestBodyTemplate",
"toolName": "toolName"
},
"mcp": {
"toolDescription": "toolDescription",
"toolName": "toolName",
"toolTitle": "toolTitle"
}
},
"description": "description",
"parameters": {
"foo": "bar"
},
"status": "TOOL_STATUS_UNSPECIFIED",
"requiresApproval": true
},
"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"
}
},
"toolSet": {
"id": "id",
"accountId": "accountId",
"createdAt": "2019-12-27T18:11:19.117Z",
"name": "name",
"profileId": "profileId",
"workspaceId": "workspaceId",
"externalId": "externalId",
"labels": {
"foo": "string"
}
}
}
}Returns Examples
{
"metadata": {
"id": "id",
"accountId": "accountId",
"createdAt": "2019-12-27T18:11:19.117Z",
"name": "name",
"profileId": "profileId",
"workspaceId": "workspaceId",
"externalId": "externalId",
"labels": {
"foo": "string"
}
},
"spec": {
"config": {
"http": {
"requestMethod": "GET",
"headers": {
"foo": "string"
},
"path": "path",
"query": "query",
"requestBodyContentType": "requestBodyContentType",
"requestBodyTemplate": "requestBodyTemplate",
"toolName": "toolName"
},
"mcp": {
"toolDescription": "toolDescription",
"toolName": "toolName",
"toolTitle": "toolTitle"
}
},
"description": "description",
"parameters": {
"foo": "bar"
},
"status": "TOOL_STATUS_UNSPECIFIED",
"requiresApproval": true
},
"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"
}
},
"toolSet": {
"id": "id",
"accountId": "accountId",
"createdAt": "2019-12-27T18:11:19.117Z",
"name": "name",
"profileId": "profileId",
"workspaceId": "workspaceId",
"externalId": "externalId",
"labels": {
"foo": "string"
}
}
}
}