MCP HubMCP Hub
スキル一覧に戻る

Convex Agents Tools

Sstobo
更新日 Today
179 閲覧
5
5
GitHubで表示
開発aiapidata

について

Convex Agents Toolsは、エージェントが定義されたツールを通じて外部関数、API、データベース操作を呼び出すことを可能にします。エージェントがデータを取得したり、アクションを実行したり、外部サービスと統合する必要がある場合に使用され、明確な分離と多段階の操作を実現します。これは、人間を介在させるワークフローと自律的なエージェントの意思決定の両方をサポートします。

クイックインストール

Claude Code

推奨
プラグインコマンド推奨
/plugin add https://github.com/Sstobo/convex-skills
Git クローン代替
git clone https://github.com/Sstobo/convex-skills.git ~/.claude/skills/Convex Agents Tools

このコマンドをClaude Codeにコピー&ペーストしてスキルをインストールします

ドキュメント

Purpose

Equips agents with the ability to take actions beyond text generation. Tools allow agents to call Convex functions, external APIs, and complex operations.

When to Use This Skill

  • Agents need to query or modify database data
  • Integrating with external APIs
  • Creating human-in-the-loop workflows
  • Agents autonomously deciding what actions to take
  • Chaining tool calls for multi-step operations

Define Tools

Create Convex-aware tools:

import { createTool } from "@convex-dev/agent";
import { z } from "zod";

export const getUserDataTool = createTool({
  description: "Fetch user information by email",
  args: z.object({
    email: z.string().email().describe("The user's email address"),
  }),
  handler: async (ctx, { email }): Promise<string> => {
    const user = await ctx.runQuery(api.users.getUserByEmail, { email });
    return user ? JSON.stringify(user) : "User not found";
  },
});

Configure Agent with Tools

const agentWithTools = new Agent(components.agent, {
  name: "Database Agent",
  languageModel: openai.chat("gpt-4o-mini"),
  tools: {
    getUserData: getUserDataTool,
  },
  maxSteps: 5, // Allow tool calls
});

Enable Automatic Tool Calling

export const autonomousAgent = action({
  args: { threadId: v.string(), request: v.string() },
  handler: async (ctx, { threadId, request }) => {
    const { thread } = await agentWithTools.continueThread(ctx, { threadId });

    const result = await thread.generateText(
      { prompt: request },
      { maxSteps: 10 } // Allow up to 10 tool calls
    );

    return result.text;
  },
});

Key Principles

  • Use Zod for validation: .describe() on fields helps LLMs understand parameters
  • Explicit return types: Always annotate handler return types
  • Automatic history: Tool calls and results saved automatically in thread
  • Context binding: Create tools inside actions where you have access to userId, etc.

Next Steps

  • See fundamentals for agent setup
  • See workflows for orchestrating multi-step operations
  • See context for tool-aware context management

GitHub リポジトリ

Sstobo/convex-skills
パス: convex-agents-tools

関連スキル

content-collections

メタ

This skill provides a production-tested setup for Content Collections, a TypeScript-first tool that transforms Markdown/MDX files into type-safe data collections with Zod validation. Use it when building blogs, documentation sites, or content-heavy Vite + React applications to ensure type safety and automatic content validation. It covers everything from Vite plugin configuration and MDX compilation to deployment optimization and schema validation.

スキルを見る

creating-opencode-plugins

メタ

This skill provides the structure and API specifications for creating OpenCode plugins that hook into 25+ event types like commands, files, and LSP operations. It offers implementation patterns for JavaScript/TypeScript modules that intercept and extend the AI assistant's lifecycle. Use it when you need to build event-driven plugins for monitoring, custom handling, or extending OpenCode's capabilities.

スキルを見る

evaluating-llms-harness

テスト

This Claude Skill runs the lm-evaluation-harness to benchmark LLMs across 60+ standardized academic tasks like MMLU and GSM8K. It's designed for developers to compare model quality, track training progress, or report academic results. The tool supports various backends including HuggingFace and vLLM models.

スキルを見る

sglang

メタ

SGLang is a high-performance LLM serving framework that specializes in fast, structured generation for JSON, regex, and agentic workflows using its RadixAttention prefix caching. It delivers significantly faster inference, especially for tasks with repeated prefixes, making it ideal for complex, structured outputs and multi-turn conversations. Choose SGLang over alternatives like vLLM when you need constrained decoding or are building applications with extensive prefix sharing.

スキルを見る