Skip to main content
Glama

ai_process

Automate and coordinate multi-step workflows for file operations, git management, web search, fetching, browser automation, and security analysis by describing your goal in natural language.

Instructions

Primary AI orchestration interface - intelligently processes complex requests by automatically selecting and coordinating multiple tools. Handles file operations, git management, web search, web fetching, browser automation, security analysis, and more. Describe your goal naturally - the AI will determine the best approach and execute multi-step workflows.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
requestYesNatural language description of what you want to accomplish. Examples: "Search for React 19 features and analyze code examples", "Find all TypeScript files with TODO comments", "Check git status and create a summary of recent changes", "Fetch the latest Next.js documentation and extract routing information"

Implementation Reference

  • The primary handler function for the 'ai_process' MCP tool. It extracts the natural language request from input arguments, validates it, delegates processing to the AIOrchestrator, and returns the AI-generated response as MCP content.
    export async function handleAIProcess(args: any, aiOrchestrator: AIOrchestrator) {
      try {
        const request = args.request;
        if (!request) {
          throw new Error('Request parameter is required');
        }
    
        logger.info(`Processing AI request: ${request.substring(0, 100)}...`);
    
        const result = await aiOrchestrator.processRequest(request);
    
        return {
          content: [
            {
              type: 'text',
              text: result.response,
            },
          ],
        };
      } catch (error) {
        logger.error('Failed to process AI request:', error as Error);
        return {
          content: [
            {
              type: 'text',
              text: `Error processing request: ${error instanceof Error ? error.message : String(error)}`,
            },
          ],
        };
      }
    }
  • Registration of the 'ai_process' tool in the main tool call dispatcher switch statement, routing calls to the handleAIProcess function.
    case 'ai_process':
      return handleAIProcess(args, aiOrchestrator);
  • JSON Schema definition for the 'ai_process' tool input, specifying a required 'request' string parameter with descriptive examples.
    inputSchema: {
      type: 'object',
      properties: {
        request: {
          type: 'string',
          description: 'Natural language description of what you want to accomplish. Examples: "Search for React 19 features and analyze code examples", "Find all TypeScript files with TODO comments", "Check git status and create a summary of recent changes", "Fetch the latest Next.js documentation and extract routing information"',
        },
      },
      required: ['request'],
      additionalProperties: false,
      $schema: 'http://json-schema.org/draft-07/schema#',
    },
  • Tool definition object for 'ai_process' returned by the listTools handler, including name, description, and input schema.
    {
      name: 'ai_process',
      description: 'Primary AI orchestration interface - intelligently processes complex requests by automatically selecting and coordinating multiple tools. Handles file operations, git management, web search, web fetching, browser automation, security analysis, and more. Describe your goal naturally - the AI will determine the best approach and execute multi-step workflows.',
      inputSchema: {
        type: 'object',
        properties: {
          request: {
            type: 'string',
            description: 'Natural language description of what you want to accomplish. Examples: "Search for React 19 features and analyze code examples", "Find all TypeScript files with TODO comments", "Check git status and create a summary of recent changes", "Fetch the latest Next.js documentation and extract routing information"',
          },
        },
        required: ['request'],
        additionalProperties: false,
        $schema: 'http://json-schema.org/draft-07/schema#',
      },
    },
  • Core processing method in AIOrchestrator class called by the tool handler. Orchestrates the AI workflow execution and formats the result with metadata.
    async processRequest(userRequest: string): Promise<AIOrchestrationResult> {
      if (!this.initialized) {
        throw new Error('AI Orchestrator not initialized. Call initialize() first.');
      }
    
      const startTime = Date.now();
      console.error(`πŸ€– AI Processing: "${userRequest}"`);
    
      try {
        // Execute AI-driven workflow
        const workflowResult = await this.workflowEngine.executeWorkflow(userRequest);
        
        const processingTime = Date.now() - startTime;
        const toolsUsed = workflowResult.context.results.map(r => r.tool);
        const successfulSteps = workflowResult.context.results.filter(r => r.success).length;
    
        console.error(`🎯 AI Processing completed in ${processingTime}ms`);
    
        return {
          success: workflowResult.success,
          response: workflowResult.finalResult,
          metadata: {
            processingTime,
            toolsUsed,
            confidence: this.calculateOverallConfidence(workflowResult.context.steps),
            workflowSteps: workflowResult.context.results.length,
            aiEnhanced: true,
          },
          rawResults: workflowResult.context.results.map(r => r.result),
        };
    
      } catch (error) {
        const processingTime = Date.now() - startTime;
        const errorMessage = error instanceof Error ? error.message : String(error);
        
        console.error(`πŸ’₯ AI Processing failed: ${errorMessage}`);
    
        return {
          success: false,
          response: `I encountered an error while processing your request: ${errorMessage}`,
          metadata: {
            processingTime,
            toolsUsed: [],
            confidence: 0,
            workflowSteps: 0,
            aiEnhanced: true,
          },
          error: errorMessage,
        };
      }
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively communicates that this is an orchestration tool that automatically selects and coordinates multiple tools, which implies mutation capabilities across various domains. However, it doesn't disclose important behavioral traits like error handling, authentication requirements, rate limits, or what happens when coordination fails. The description adds value by explaining the orchestration behavior but leaves significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded with the core purpose in the first sentence. The second sentence expands on capabilities, and the third provides clear usage guidance. While efficient, the middle sentence listing domains ('file operations, git management...') could be slightly more concise, but overall it earns its place by clarifying scope.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex orchestration tool with no annotations and no output schema, the description provides good purpose and usage context but lacks important behavioral details. It doesn't explain what the tool returns (success/failure indicators, workflow results), doesn't mention constraints or limitations, and doesn't address error scenarios. Given the tool's complexity and lack of structured metadata, the description should do more to compensate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, so the schema already fully documents the single 'request' parameter. The description adds meaningful context by emphasizing this should be a 'natural language description' and providing concrete examples of what types of requests are appropriate. While it doesn't add technical details beyond the schema, it significantly enhances understanding of how to formulate effective requests.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose as an 'AI orchestration interface' that 'intelligently processes complex requests by automatically selecting and coordinating multiple tools.' It specifically distinguishes this from sibling tools like ai_status and get_info by emphasizing its multi-tool coordination capability and broad domain coverage (file operations, git management, web search, etc.).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool: 'Describe your goal naturally - the AI will determine the best approach and execute multi-step workflows.' It implicitly suggests this is for complex, multi-step tasks rather than simple status checks (ai_status) or basic information retrieval (get_info), making the context clear without naming alternatives directly.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Phoenixrr2113/Orchestrator-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server