Member Junction
    Preparing search index...

    Agent Tool Adapter

    Provides a high-level interface for AI agents to discover and use MCP tools. Handles connection management, tool format conversion, and execution.

    const adapter = new AgentToolAdapter(contextUser);

    // Get all available tools in OpenAI format
    const openAITools = await adapter.getToolsForOpenAI();

    // Execute a tool by name
    const result = await adapter.executeTool('github_create_issue', {
    title: 'Bug report',
    body: 'Description of the bug'
    });
    Index

    Constructors

    Methods

    • Executes a tool by its ID or name

      Parameters

      • toolIdOrName: string

        Tool ID (with connection prefix) or just the tool name

      • args: Record<string, unknown>

        Arguments to pass to the tool

      • OptionalconnectionId: string

        Optional connection ID (required if using tool name only)

      Returns Promise<AgentToolResult>

      Tool execution result

    • Checks if a specific tool is available

      Parameters

      • toolIdOrName: string

        Tool ID or name

      Returns Promise<boolean>

      True if the tool is available