Skip to main content
Glama

project_execute_analysis

Analyze project data by executing Python code generated from natural language requests to extract insights and metrics.

Instructions

Execute intelligent analysis on specific project instance with ultra-fast performance. Automatically generates Python code based on analysis request.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject identifier to execute analysis on
analysisRequestYesNatural language description of the analysis you want to perform (e.g., 'get network statistics', 'analyze node distribution', 'check link lengths')
returnFormatNoFormat of results: summary (key metrics), detailed (comprehensive), raw (full data)summary

Implementation Reference

  • MCP server.tool registration for 'project_execute_analysis', including input schema (Zod), description, and inline handler function that delegates execution to projectManager.executeProjectAnalysis and formats the response.
    server.tool(
      "project_execute_analysis",
      "Execute analysis on specific project instance with ultra-fast performance",
      {
        projectId: z.string().describe("Project identifier to execute analysis on"),
        analysisCode: z.string().describe("Python code to execute on the project instance"),
        description: z.string().optional().describe("Optional description of the analysis")
      },
      async ({ projectId, analysisCode, description }) => {
        try {
          const result = await projectManager.executeProjectAnalysis(projectId, analysisCode, description);
          
          if (result.success) {
            return {
              content: [
                {
                  type: "text",
                  text: `🚀 **Analisi Completata** (${result.projectInfo?.projectName})\n\n⚡ **Tempo esecuzione:** ${result.executionTimeMs}ms\n\n📊 **Risultati:**\n\`\`\`json\n${JSON.stringify(result.result, null, 2)}\n\`\`\``
                }
              ]
            };
          } else {
            return {
              content: [
                {
                  type: "text",
                  text: `❌ **Errore Analisi**\n\n${result.error}`
                }
              ]
            };
          }
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `❌ **Errore:** ${error instanceof Error ? error.message : String(error)}`
              }
            ]
          };
        }
      }
    );
  • Core handler method in ProjectInstanceManager that retrieves the project instance, validates it's active, and delegates to executeOnInstance for executing the analysis code via the instance's controller.
    public async executeProjectAnalysis(projectId: string, analysisCode: string, description?: string): Promise<{
      success: boolean;
      result?: any;
      error?: string;
      executionTimeMs?: number;
      projectInfo?: any;
    }> {
      const instance = this.projectInstances.get(projectId);
      
      if (!instance || !instance.isActive) {
        return {
          success: false,
          error: `Instance '${projectId}' is not active. Use 'project_start_instance' to start it first.`
        };
      }
    
      return this.executeOnInstance(instance, analysisCode, description);
    }
  • Private helper method that updates last used time, executes the analysis code using the project instance's controller.executeCustomCode, and packages the result with project info.
    private async executeOnInstance(instance: ProjectInstance, analysisCode: string, description?: string): Promise<{
      success: boolean;
      result?: any;
      error?: string;
      executionTimeMs?: number;
      projectInfo?: any;
    }> {
      try {
        instance.lastUsed = Date.now();
        
        const result = await instance.controller.executeCustomCode(analysisCode, description);
        
        return {
          success: result.success,
          result: result.result,
          error: result.error,
          executionTimeMs: result.executionTimeMs,
          projectInfo: {
            projectName: instance.config.name,
            projectId: instance.config.name.toLowerCase(),
            stats: instance.stats
          }
        };
      } catch (error) {
        return {
          success: false,
          error: error instanceof Error ? error.message : String(error)
        };
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'ultra-fast performance' and 'automatically generates Python code,' which adds some context beyond basic functionality. However, it lacks critical details: whether this is a read-only or destructive operation, what permissions are required, how errors are handled, or what the output looks like. For a tool that executes analysis and generates code, this is a significant gap in transparency.

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 concise and front-loaded, consisting of two sentences that efficiently convey the core functionality. The first sentence covers the main action and performance, while the second adds the unique code generation aspect. There's no unnecessary verbiage, and every sentence contributes directly to understanding the tool's purpose.

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

Completeness2/5

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

Given the complexity of executing analysis and generating Python code, with no annotations and no output schema, the description is incomplete. It fails to address key contextual aspects: what the analysis entails, how the Python code is used or returned, what happens to the project instance, or potential side effects. For a tool with this level of functionality, more detail is needed to ensure safe and effective use by an AI agent.

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

Parameters3/5

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

The input schema has 100% description coverage, providing clear documentation for all three parameters. The description doesn't add any meaningful semantics beyond what the schema already states—it doesn't explain parameter interactions, provide examples beyond the schema's hints, or clarify the 'analysisRequest' format further. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but also doesn't detract.

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

Purpose4/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: 'Execute intelligent analysis on specific project instance' and 'Automatically generates Python code based on analysis request.' It specifies the verb (execute analysis) and resource (project instance) with the unique aspect of Python code generation. However, it doesn't explicitly differentiate from siblings like 'project_execute' or 'visum_custom_analysis,' which might have overlapping functionality.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With many sibling tools like 'project_execute,' 'visum_custom_analysis,' and 'visum_network_analysis,' there's no indication of when this specific analysis tool is preferred, what prerequisites exist, or when not to use it. The mention of 'ultra-fast performance' is a feature hint but not a usage guideline.

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

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/multiluca2020/visum-thinker-mcp-server'

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