| name | cohere-core-workflow-b |
| description | Build tool-use agents and function calling with Cohere API v2.
Use when implementing multi-step agents, function calling,
or building autonomous tool-using workflows with Cohere.
Trigger with phrases like "cohere tool use", "cohere agents",
"cohere function calling", "cohere multi-step".
|
| allowed-tools | Read, Write, Edit, Bash(npm:*), Grep |
| version | 1.5.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","ai","nlp","cohere"] |
| compatibility | Designed for Claude Code |
Cohere Tool Use & Agents (Core Workflow B)
Overview
Build multi-step tool-using agents with Cohere's Chat API v2. The model decides which tools to call, you execute them, and feed results back in a loop until the task is complete.
Prerequisites
- Completed
cohere-install-auth setup
- Understanding of
cohere-core-workflow-a (RAG)
- Command R7B or newer model (required for tool use)
Instructions
Step 1: Define Tools
import { CohereClientV2 } from 'cohere-ai';
const cohere = new CohereClientV2();
const tools = [
{
type: 'function' as const,
function: {
name: 'get_weather',
description: 'Get current weather for a city',
parameters: {
type: 'object' as const,
properties: {
city: { type: 'string', description: 'City name' },
unit: { type: 'string', enum: ['celsius', 'fahrenheit'], description: 'Temperature unit' },
},
required: ['city'],
},
},
},
{
type: 'function' ,
: {
: ,
: ,
: {
: ,
: {
: { : , : },
: { : , : },
},
: [],
},
},
},
];