Skip to main content
Glama

createProject

Create a new project with a title and email using the DeepWriter API key for authentication. Streamlines project setup for content generation and management.

Instructions

Create a new project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_keyYesThe DeepWriter API key for authentication.
emailYesThe email associated with the project.
titleYesThe title for the new project.

Implementation Reference

  • The core handler implementation for the 'createProject' tool. This defines the tool object with name, description, and the execute function that validates inputs, calls the DeepWriter API via apiClient.createProject, and returns MCP-formatted response.
    export const createProjectTool = {
      name: "createProject",
      description: "Create a new project",
      // TODO: Add input/output schema validation if needed
      async execute(args: CreateProjectInputArgs): Promise<CreateProjectMcpOutput> {
        console.error(`Executing createProject tool with title: ${args.title}...`);
    
        // Get API key from environment
        const apiKey = process.env.DEEPWRITER_API_KEY;
        if (!apiKey) {
          throw new Error("DEEPWRITER_API_KEY environment variable is required");
        }
        if (!args.title || args.title.trim() === '') {
          throw new Error("Missing required argument: title (cannot be empty)");
        }
        if (!args.email) {
          throw new Error("Missing required argument: email");
        }
    
        try {
          // Call the actual API client function
          const apiResponse = await apiClient.createProject(apiKey, args.title, args.email);
          console.error(`API call successful for createProject. New project ID: ${apiResponse.id}`);
    
          // Transform the API response into MCP format
          const mcpResponse: CreateProjectMcpOutput = {
            content: [
              { type: 'text', text: `Successfully created project '${args.title}' with ID: ${apiResponse.id}` }
            ]
          };
    
          return mcpResponse; // Return the MCP-compliant structure
        } catch (error) {
          console.error(`Error executing createProject tool: ${error}`);
          // Format error for MCP response
          const errorMessage = error instanceof Error ? error.message : String(error);
          throw new Error(`Failed to create project: ${errorMessage}`);
        }
      }
    };
  • src/index.ts:233-254 (registration)
    Registration of the 'createProject' tool with the MCP server using server.tool(). Includes inline input schema validation with Zod, a wrapper async handler that delegates to createProjectTool.execute, and tool annotations.
    server.tool(
      createProjectTool.name,
      createProjectTool.description,
      {
        title: z.string().describe("The title for the new project."),
        email: z.string().email().describe("The email associated with the project.")
      },
      async ({ title, email }: CreateProjectParams) => {
        console.error(`SDK invoking ${createProjectTool.name}...`);
        const result = await createProjectTool.execute({ title, email });
        return {
          content: result.content,
          annotations: {
            title: "Create Project",
            readOnlyHint: false,
            destructiveHint: false, // Creates but doesn't destroy
            idempotentHint: false, // Creates new project each time
            openWorldHint: false
          }
        };
      }
    );
  • Zod input schema definition for createProject tool parameters (title and email), matching the inline schema used in registration.
    const createProjectInputSchema = z.object({
      title: z.string().describe("The title for the new project."),
      email: z.string().email().describe("The email associated with the project.")
    });
  • Helper function that makes the actual HTTP POST request to the DeepWriter API to create a project. Called by the tool handler. Note: email is accepted but not used in API call.
    export async function createProject(apiKey: string, title: string, email: string): Promise<CreateProjectResponse> {
      console.error(`Calling actual createProject API with title: ${title}`);
      if (!apiKey) {
        throw new Error("API key is required for createProject");
      }
      if (!title || title.trim() === '') {
        throw new Error("Project title is required for createProject");
      }
      // Note: email parameter accepted for MCP interface compatibility but not sent to API
    
      // Use the correct field name 'newProjectName' for the API request body (email not needed)
      const body: CreateProjectApiInput = { newProjectName: title };
      return makeApiRequest<CreateProjectResponse>('/api/createProject', apiKey, 'POST', body);
    }
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 something, implying a write operation, but doesn't mention authentication needs (though the schema covers this), potential side effects, error conditions, or what the response might look like. This is a significant gap 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, clear sentence with zero wasted words. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly without unnecessary elaboration.

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 a creation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what a 'project' is, what happens after creation, or any behavioral traits beyond the basic action, leaving critical gaps for the agent to operate effectively.

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 schema description coverage is 100%, with all three parameters (api_key, email, title) well-documented in the schema. The description adds no additional parameter information beyond what the schema provides, so it meets the baseline score of 3 for high schema coverage.

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

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Create a new project' clearly states the action (create) and resource (project), which is adequate. However, it doesn't differentiate from sibling tools like 'updateProject' or specify what constitutes a 'project' in this context, making it somewhat vague but functional.

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 such as 'updateProject' or 'listProjects'. It lacks context about prerequisites, timing, or exclusions, leaving the agent to infer usage from the tool name alone.

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

Related 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/deepwriter-ai/Deepwriter-MCP'

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