Skip to main content
Glama
ghiloufibg

Maven Project Generator MCP

by ghiloufibg

create_maven_project

Generate a new Maven project with standard structure by specifying groupId, artifactId, and optional parameters like project type and Java version.

Instructions

Creer un nouveau projet Maven vide avec la structure standard

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
groupIdYesGroup ID du projet (ex: com.example)
artifactIdYesArtifact ID du projet (ex: mon-plugin)
versionNoVersion du projet (ex: 1.0.0)1.0.0
nameNoNom du projet
descriptionNoDescription du projet
javaVersionNoVersion de Java (ex: 17)17
projectTypeNoType de projet Mavenapplication

Implementation Reference

  • Handler implementation for create_maven_project tool.
    async function createMavenProject(args: any) {
      currentProject = {
        groupId: args.groupId,
        artifactId: args.artifactId,
        version: args.version || "1.0.0",
        name: args.name || args.artifactId,
        description: args.description || "",
        javaVersion: args.javaVersion || "17",
        files: {},
      };
    
      const pomXml = generateDefaultPom(currentProject, args.projectType || "application");
      currentProject.files["pom.xml"] = pomXml;
    
      if (args.projectType === "plugin") {
        const mainClass = generateDefaultMojo(currentProject);
        const packagePath = currentProject.groupId.replace(/\./g, "/");
        currentProject.files[`src/main/java/${packagePath}/MyMojo.java`] = mainClass;
      } else {
        const mainClass = generateDefaultMainClass(currentProject);
        const packagePath = currentProject.groupId.replace(/\./g, "/");
        currentProject.files[`src/main/java/${packagePath}/Main.java`] = mainClass;
      }
    
      return {
        content: [
          {
            type: "text",
            text: `Projet Maven cree avec succes!\n\n` +
                  `Details du projet:\n` +
                  `- Group ID: ${currentProject.groupId}\n` +
                  `- Artifact ID: ${currentProject.artifactId}\n` +
                  `- Version: ${currentProject.version}\n` +
                  `- Type: ${args.projectType || "application"}\n` +
                  `- Java Version: ${currentProject.javaVersion}\n\n` +
                  `Structure creee:\n` +
                  `- pom.xml\n` +
                  `- ${args.projectType === "plugin" ? "MyMojo.java (classe de plugin)" : "Main.java (classe principale)"}\n\n` +
                  `Prochaines etapes:\n` +
                  `- Utilisez 'add_java_file' pour ajouter des classes\n` +
                  `- Utilisez 'add_resource_file' pour ajouter des ressources\n` +
                  `- Utilisez 'generate_zip' pour creer le package final`,
          },
        ],
      };
    }
  • Schema definition for the create_maven_project tool.
    {
      name: "create_maven_project",
      description: "Creer un nouveau projet Maven vide avec la structure standard",
      inputSchema: {
        type: "object",
        properties: {
          groupId: {
            type: "string",
            description: "Group ID du projet (ex: com.example)",
          },
          artifactId: {
            type: "string",
            description: "Artifact ID du projet (ex: mon-plugin)",
          },
          version: {
            type: "string",
            description: "Version du projet (ex: 1.0.0)",
            default: "1.0.0",
          },
          name: {
            type: "string",
            description: "Nom du projet",
          },
          description: {
            type: "string",
            description: "Description du projet",
          },
          javaVersion: {
            type: "string",
            description: "Version de Java (ex: 17)",
            default: "17",
          },
          projectType: {
            type: "string",
            description: "Type de projet Maven",
            enum: ["plugin", "library", "application"],
  • src/index.ts:215-216 (registration)
    Registration/routing of the create_maven_project tool.
    case "create_maven_project":
      return await createMavenProject(args);
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 creates a new Maven project but doesn't specify whether this is a destructive operation, what permissions are needed, where the project is created, or what happens on failure. This leaves significant gaps for a mutation tool.

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 purpose without any fluff or redundancy. It's front-loaded and appropriately sized for its function.

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 creating a Maven project (a mutation operation), no annotations, and no output schema, the description is incomplete. It lacks details on behavioral traits, error handling, and output expectations, making it inadequate for 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?

Schema description coverage is 100%, so the schema fully documents all 7 parameters. The description adds no additional parameter semantics beyond implying standard Maven structure, which is already covered by the schema's detailed descriptions and defaults. This meets the baseline for high schema coverage.

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 ('Creer un nouveau projet Maven vide') and the resource ('projet Maven'), specifying it creates a new empty Maven project with standard structure. However, it doesn't explicitly differentiate from sibling tools like 'set_pom_xml' or 'generate_zip', which might also relate to project creation or management.

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, when not to use it, or how it relates to sibling tools such as 'add_any_file' or 'clear_project', leaving the agent to infer usage context.

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