Skip to main content
Glama
ghiloufibg

Maven Project Generator MCP

by ghiloufibg

generate_zip

Creates and saves Maven projects as ZIP files for easy distribution and deployment, allowing customizable output paths.

Instructions

Generer et sauvegarder le projet Maven en ZIP

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
outputPathNoChemin de sortie pour le fichier ZIP (optionnel, defaut: ./maven-project.zip)

Implementation Reference

  • The implementation of the generate_zip tool.
    async function generateZip(args: any) {
      if (Object.keys(currentProject.files).length === 0) {
        throw new Error("Aucun projet a generer. Creez d'abord un projet avec 'create_maven_project'.");
      }
    
      const zip = new JSZip();
      const projectFolder = zip.folder(currentProject.artifactId);
    
      if (!projectFolder) {
        throw new Error("Erreur lors de la creation du dossier dans le ZIP");
      }
    
      for (const [filePath, content] of Object.entries(currentProject.files)) {
        projectFolder.file(filePath, content);
      }
    
      const zipContent = await zip.generateAsync({ type: "nodebuffer" });
      const outputPath = args.outputPath || `./maven-project-${currentProject.artifactId}.zip`;
      await fs.writeFile(outputPath, zipContent);
    
      const absolutePath = path.resolve(outputPath);
    
      return {
        content: [
          {
            type: "text",
            text: `Projet Maven genere avec succes!\n\n` +
                  `Fichier ZIP cree: ${absolutePath}\n` +
                  `Nombre de fichiers: ${Object.keys(currentProject.files).length}\n` +
                  `Projet: ${currentProject.groupId}:${currentProject.artifactId}:${currentProject.version}\n\n` +
                  `Structure du projet:\n` +
                  Object.keys(currentProject.files)
                    .sort()
                    .map(file => `- ${file}`)
                    .join('\n') +
                  `\n\nLe projet est pret a etre importe dans votre IDE!\n` +
                  `Commandes Maven disponibles:\n` +
                  `- mvn clean compile\n` +
                  `- mvn clean package\n` +
                  `- mvn clean install`,
          },
        ],
      };
    }
  • src/index.ts:171-182 (registration)
    Tool registration for generate_zip.
      name: "generate_zip",
      description: "Generer et sauvegarder le projet Maven en ZIP",
      inputSchema: {
        type: "object",
        properties: {
          outputPath: {
            type: "string",
            description: "Chemin de sortie pour le fichier ZIP (optionnel, defaut: ./maven-project.zip)",
          },
        },
      },
    },
Behavior2/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 states the tool generates and saves a ZIP file, implying a write operation, but doesn't cover critical aspects like whether it overwrites existing files, requires specific project structure, has side effects (e.g., modifying the project), or error handling. This leaves significant gaps for safe agent invocation.

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

Conciseness5/5

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

The description is a single, efficient sentence in French that directly states the tool's function without unnecessary words. It's front-loaded with the core action, making it easy to parse quickly.

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 tool involves file generation and saving (a mutation operation), the lack of annotations and output schema means the description should compensate more. It doesn't explain what the ZIP contains (e.g., full project structure), success/failure responses, or dependencies on other tools. This is inadequate for a tool that modifies the filesystem.

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, documenting the optional 'outputPath' parameter with its default value. The description adds no additional parameter semantics beyond what the schema provides, such as format details or constraints. Baseline 3 is appropriate since the schema does the heavy lifting.

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 action ('Generer et sauvegarder') and the resource ('le projet Maven en ZIP'), making the purpose understandable. However, it doesn't explicitly differentiate this tool from siblings like 'create_maven_project' or 'add_any_file', which could also involve project handling, so it misses full sibling distinction.

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. It doesn't mention prerequisites (e.g., needing an existing Maven project), exclusions, or how it relates to siblings like 'create_maven_project' for project creation or 'list_files' for checking project state.

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/ghiloufibg/maven-mcp-server'

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