Skip to main content
The tools API provides methods to discover and execute tools across 250+ integrations. Tools are individual actions like GITHUB_CREATE_ISSUE or GMAIL_SEND_EMAIL.

Methods

get()

Fetch tools wrapped in your provider’s format.
// Get tools by filters
async get<T extends TProvider>(
  userId: string,
  filters: ToolListParams,
  options?: ProviderOptions<TProvider>
): Promise<ReturnType<T['wrapTools']>>

// Get a single tool by slug
async get<T extends TProvider>(
  userId: string,
  slug: string,
  options?: ProviderOptions<TProvider>
): Promise<ReturnType<T['wrapTools']>>
userId
string
required
User ID for authentication and tracking
filters
ToolListParams
options
ProviderOptions
import { Composio } from '@composio/core';
import { OpenAIProvider } from '@composio/openai';

const composio = new Composio({
  apiKey: 'your-key',
  provider: new OpenAIProvider()
});

const tools = await composio.tools.get('default', {
  toolkits: ['github'],
  limit: 10
});

// Use with OpenAI
const response = await openai.chat.completions.create({
  model: 'gpt-4',
  tools,
  messages: [{ role: 'user', content: 'Create an issue' }]
});

execute()

Execute a tool directly.
async execute(
  slug: string,
  body: ToolExecuteParams,
  modifiers?: ExecuteToolModifiers
): Promise<ToolExecuteResponse>
slug
string
required
Tool slug to execute (e.g., GITHUB_CREATE_ISSUE)
body
ToolExecuteParams
required
modifiers
ExecuteToolModifiers
const result = await composio.tools.execute('GITHUB_CREATE_ISSUE', {
  userId: 'default',
  arguments: {
    owner: 'composio',
    repo: 'sdk',
    title: 'Bug report',
    body: 'Description of the bug'
  }
});

console.log(result.data); // Created issue
console.log(result.successful); // true

getRawComposioTools()

Fetch tools in raw Composio format without provider wrapping.
async getRawComposioTools(
  query: ToolListParams,
  options?: SchemaModifierOptions
): Promise<ToolList>
Example:
const tools = await composio.tools.getRawComposioTools({
  toolkits: ['github'],
  limit: 5
});

console.log(tools[0].slug); // GITHUB_CREATE_ISSUE
console.log(tools[0].inputParameters); // JSON Schema

getRawComposioToolBySlug()

Fetch a single tool in raw format.
async getRawComposioToolBySlug(
  slug: string,
  options?: ToolRetrievalOptions
): Promise<Tool>
Example:
const tool = await composio.tools.getRawComposioToolBySlug('GITHUB_CREATE_ISSUE');

console.log(tool.name); // "Create Issue"
console.log(tool.version); // "20250909_00"
console.log(tool.inputParameters); // JSON Schema

createCustomTool()

Create a custom tool with your own logic.
async createCustomTool<T extends CustomToolInputParameter>(
  body: CustomToolOptions<T>
): Promise<Tool>
body
CustomToolOptions
required
import { z } from 'zod';

const tool = await composio.tools.createCustomTool({
  name: 'Weather Search',
  slug: 'WEATHER_SEARCH',
  description: 'Get current weather for a location',
  inputParams: z.object({
    location: z.string().describe('City name')
  }),
  execute: async (input) => {
    const weather = await fetch(`https://api.weather.com/${input.location}`);
    return {
      data: await weather.json(),
      error: null,
      successful: true
    };
  }
});

getToolsEnum()

Get a list of all available tool slugs.
async getToolsEnum(): Promise<ToolRetrieveEnumResponse>
Example:
const allTools = await composio.tools.getToolsEnum();
console.log(allTools.items); // ['GITHUB_CREATE_ISSUE', 'SLACK_SEND_MESSAGE', ...]

Types

ToolExecuteResponse

Result from tool execution.
interface ToolExecuteResponse {
  data: Record<string, unknown>; // Tool output
  error: string | null; // Error message if failed
  successful: boolean; // Whether execution succeeded
  logId?: string; // Log ID for debugging
  sessionInfo?: Record<string, unknown>; // Session metadata
}

Tool

Raw tool schema.
interface Tool {
  slug: string; // Tool identifier
  name: string; // Human-readable name
  description: string; // What the tool does
  inputParameters: JSONSchema; // Input schema
  outputParameters: JSONSchema; // Output schema
  toolkit?: { // Associated toolkit
    name: string;
    slug: string;
  };
  version?: string; // Toolkit version
  availableVersions?: string[]; // All available versions
  isDeprecated?: boolean; // Deprecated status
  isNoAuth?: boolean; // Requires no authentication
}

Next Steps

Toolkits API

Discover available toolkits

Connected Accounts

Manage user authentication

Custom Tools

Create custom tools

Providers

Choose your AI framework

Build docs developers (and LLMs) love