create-project
Set up a new project or workspace by specifying its name and optional details using the Model Context Protocol on the Opik MCP Server.
Instructions
Create a new project/workspace
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | No | Description of the project | |
| name | Yes | Name of the project | |
| workspaceName | No | Workspace name to use instead of the default |
Implementation Reference
- src/tools/project.ts:49-71 (handler)The main handler function for the 'create-project' tool. It extracts arguments, constructs a POST request body, calls makeApiRequest to the /v1/private/projects endpoint, and returns a text response indicating success or error.async (args: any) => { const { name, description, workspaceName } = args; const requestBody: any = { name }; if (description) requestBody.description = description; const response = await makeApiRequest<any>( `/v1/private/projects`, { method: 'POST', body: JSON.stringify(requestBody), }, workspaceName ); return { content: [ { type: 'text', text: response.error || 'Successfully created project', }, ], }; }
- src/tools/project.ts:44-48 (schema)Zod input schema for the create-project tool defining required 'name' and optional 'description' and 'workspaceName' parameters.{ name: z.string().min(1).describe('Name of the project'), description: z.string().optional().describe('Description of the project'), workspaceName: z.string().optional().describe('Workspace name to use instead of the default'), },
- src/tools/project.ts:41-72 (registration)Registers the 'create-project' tool on the MCP server within the loadProjectTools function, specifying name, description, input schema, and handler.server.tool( 'create-project', 'Create a new project', { name: z.string().min(1).describe('Name of the project'), description: z.string().optional().describe('Description of the project'), workspaceName: z.string().optional().describe('Workspace name to use instead of the default'), }, async (args: any) => { const { name, description, workspaceName } = args; const requestBody: any = { name }; if (description) requestBody.description = description; const response = await makeApiRequest<any>( `/v1/private/projects`, { method: 'POST', body: JSON.stringify(requestBody), }, workspaceName ); return { content: [ { type: 'text', text: response.error || 'Successfully created project', }, ], }; } );
- src/index.ts:86-88 (registration)Top-level conditional registration of project tools, including 'create-project', by invoking loadProjectTools when the 'projects' toolset is enabled in configuration.if (config.enabledToolsets.includes('projects')) { server = loadProjectTools(server); logToFile('Loaded projects toolset');