Skip to main content
Glama

init_project

Set up the Git Conflict MCP environment by specifying the project root directory path to enable conflict detection and resolution workflows.

Instructions

Initialize the project by setting the root directory path. This must be the first tool called to set up the environment.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path to the git project root.

Implementation Reference

  • The handler function for the init_project tool. It validates the provided path as a directory, sets the project path in the state, and returns a success or error message.
    async ({ path: p }) => { try { const stats = await fs.stat(p); if (!stats.isDirectory()) { return { content: [{ type: "text", text: "Path is not a directory." }], isError: true }; } state.setProjectPath(p); return { content: [{ type: "text", text: `initialized at ${p}` }] }; } catch (e) { return { content: [{ type: "text", text: `Invalid path: ${e}` }], isError: true }; } }
  • Zod input schema defining the required 'path' parameter as a string with description.
    inputSchema: z.object({ path: z.string().describe("Absolute path to the git project root."), }),
  • The registerInitProject function that registers the 'init_project' tool with the MCP server, including its name, description, schema, and handler.
    export function registerInitProject(server: McpServer) { server.registerTool( "init_project", { description: "Initialize the project by setting the root directory path. This must be the first tool called to set up the environment.", inputSchema: z.object({ path: z.string().describe("Absolute path to the git project root."), }), }, async ({ path: p }) => { try { const stats = await fs.stat(p); if (!stats.isDirectory()) { return { content: [{ type: "text", text: "Path is not a directory." }], isError: true }; } state.setProjectPath(p); return { content: [{ type: "text", text: `initialized at ${p}` }] }; } catch (e) { return { content: [{ type: "text", text: `Invalid path: ${e}` }], isError: true }; } } ); }
  • Invocation of registerInitProject within the registerTools function to register the init_project tool.
    registerInitProject(server);

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/mattyatea/git-conflict-mcp'

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