Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

657 B
Raw Blame
/**
 * Mastra × Composio — direct tools
 *
 * Fetches a Composio tool as a Mastra tool and lets a Mastra Agent call it.
 * Uses the unauthenticated HACKERNEWS toolkit, so no connected account is
 * required — set only the two keys below and run.
 *
 * Prerequisites:
 *   - COMPOSIO_API_KEY   (https://app.composio.dev)
 *   - OPENAI_API_KEY     (or swap the model — see README)
 *
 * Run:
 *   bun ts/examples/mastra/src/index.ts
 */
import 'dotenv/config';

import { runDirectHackerNewsAgent } from './hackernews-agent/direct';

const text = await runDirectHackerNewsAgent(process.env);

console.log('\n🤖 Agent response:\n');
console.log(text);