Skip to main content
Glama

generateWork

Generate project-specific content using the DeepWriter MCP Server by providing an API key and project ID. Customize output by adjusting default settings.

Instructions

Generate content for a project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_keyYesThe DeepWriter API key for authentication.
is_defaultNoWhether to use default settings (optional, defaults to true).
project_idYesThe ID of the project to generate work for.

Implementation Reference

  • The primary handler for the generateWizardWork tool (note: tool name is generateWizardWork, implemented in generateWork.ts file). It handles input validation, calls the DeepWriter API client, and returns MCP-formatted response.
    export const generateWizardWorkTool = {
      name: "generateWizardWork",
      description: "Generate content using the enhanced wizard workflow with comprehensive parameter support",
      async execute(args: GenerateWizardWorkInputArgs): Promise<GenerateWizardWorkMcpOutput> {
        console.error(`Executing generateWizardWork tool for project ID: ${args.project_id}...`);
    
        // 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.project_id) {
          throw new Error("Missing required argument: project_id");
        }
        if (!args.prompt) {
          throw new Error("Missing required argument: prompt");
        }
        if (!args.author) {
          throw new Error("Missing required argument: author");
        }
        if (!args.email) {
          throw new Error("Missing required argument: email");
        }
    
        try {
          // Prepare the parameters for the API client (API expects projectId not project_id)
          const wizardParams = {
            projectId: args.project_id,  // Convert project_id to projectId for API
            prompt: args.prompt,
            author: args.author,
            email: args.email,
            outline_text: args.outline_text,
            has_technical_diagrams: args.has_technical_diagrams,
            has_tableofcontents: args.has_tableofcontents,
            use_web_research: args.use_web_research,
            page_length: args.page_length,
            questions_and_answers: args.questions_and_answers,
            mode: args.mode,
            isDefault: args.isDefault,
            max_pages: args.max_pages,
            free_trial_mode: args.free_trial_mode
          };
    
          // Call the actual API client function
          const apiResponse = await apiClient.generateWizardWork(apiKey, wizardParams);
          console.error(`API call successful for generateWizardWork. Job ID: ${apiResponse.jobId}`);
    
          // Transform the API response into MCP format
          const mcpResponse: GenerateWizardWorkMcpOutput = {
            content: [
              { type: 'text', text: `Successfully started wizard work generation for project ID ${args.project_id}. Job ID: ${apiResponse.jobId}. Message: ${apiResponse.message}` }
            ]
          };
    
          return mcpResponse;
        } catch (error) {
          console.error(`Error executing generateWizardWork tool: ${error}`);
          const errorMessage = error instanceof Error ? error.message : String(error);
          throw new Error(`Failed to generate wizard work for project ID ${args.project_id}: ${errorMessage}`);
        }
      }
    };
  • API client helper function that makes the HTTP POST request to the external DeepWriter API endpoint /api/generateWizardWork.
    export async function generateWizardWork(
      apiKey: string,
      params: GenerateWizardWorkInputBody
    ): Promise<GenerateWizardWorkResponse> {
      console.error(`Calling actual generateWizardWork API for project ID: ${params.projectId}`);
      if (!apiKey) {
        throw new Error("API key is required for generateWizardWork");
      }
      if (!params.projectId) {
        throw new Error("Project ID is required for generateWizardWork");
      }
      if (!params.prompt) {
        throw new Error("Prompt is required for generateWizardWork");
      }
      if (!params.author) {
        throw new Error("Author is required for generateWizardWork");
      }
      if (!params.email) {
        throw new Error("Email is required for generateWizardWork");
      }
    
      // Add isDefault: true as required by the API (from demo script)
      const requestBody = {
        ...params,
        isDefault: true
      };
    
      return makeApiRequest<GenerateWizardWorkResponse>('/api/generateWizardWork', apiKey, 'POST', requestBody);
    }
  • src/index.ts:313-346 (registration)
    Registration of the generateWizardWork tool in the MCP server, including inline Zod input schema and execution wrapper.
    server.tool(
      generateWizardWorkTool.name,
      generateWizardWorkTool.description,
      {
        project_id: z.string().describe("The ID of the project to generate work for."),
        prompt: z.string().describe("Main generation prompt describing the content to create."),
        author: z.string().describe("Author name for the document."),
        email: z.string().email().describe("Author email address."),
        outline_text: z.string().optional().describe("Additional outline instructions or structure guidance."),
        has_technical_diagrams: z.enum(['auto', 'on', 'off']).optional().describe("Whether to include technical diagrams."),
        has_tableofcontents: z.enum(['auto', 'on', 'off']).optional().describe("Whether to include table of contents."),
        use_web_research: z.enum(['auto', 'on', 'off']).optional().describe("Whether to use web research."),
        page_length: z.string().optional().describe("Desired document length specification."),
        questions_and_answers: z.string().optional().describe("JSON string of follow-up questions and answers."),
        mode: z.enum(['deepwriter', 'benchmark', 'romance', 'homework', 'deepseek', 'skunkworks']).optional().describe("Content generation mode."),
        isDefault: z.boolean().optional().describe("Whether to use default system API key."),
        max_pages: z.number().min(1).max(350).optional().describe("Maximum pages allowed for generation."),
        free_trial_mode: z.enum(['true', 'false']).optional().describe("Whether user is on free trial.")
      },
      async (params: GenerateWizardWorkParams) => {
        console.error(`SDK invoking ${generateWizardWorkTool.name}...`);
        const result = await generateWizardWorkTool.execute(params);
        return {
          content: result.content,
          annotations: {
            title: "Generate Wizard Work",
            readOnlyHint: false,
            destructiveHint: false,
            idempotentHint: false,
            openWorldHint: true
          }
        };
      }
    );
  • Zod input schema definition for the generateWizardWork tool (defined but not directly used in registration; inline schema used instead).
    const generateWizardWorkInputSchema = z.object({
      project_id: z.string().describe("The ID of the project to generate work for."),
      prompt: z.string().describe("Main generation prompt describing the content to create."),
      author: z.string().describe("Author name for the document."),
      email: z.string().email().describe("Author email address."),
      outline_text: z.string().optional().describe("Additional outline instructions or structure guidance."),
      has_technical_diagrams: z.enum(['auto', 'on', 'off']).optional().describe("Whether to include technical diagrams."),
      has_tableofcontents: z.enum(['auto', 'on', 'off']).optional().describe("Whether to include table of contents."),
      use_web_research: z.enum(['auto', 'on', 'off']).optional().describe("Whether to use web research."),
      page_length: z.string().optional().describe("Desired document length specification."),
      questions_and_answers: z.string().optional().describe("JSON string of follow-up questions and answers."),
      mode: z.enum(['deepwriter', 'benchmark', 'romance', 'homework', 'deepseek', 'skunkworks']).optional().describe("Content generation mode."),
      isDefault: z.boolean().optional().describe("Whether to use default system API key."),
      max_pages: z.number().min(1).max(350).optional().describe("Maximum pages allowed for generation."),
      free_trial_mode: z.enum(['true', 'false']).optional().describe("Whether user is on free trial.")
    });
  • TypeScript input interface for the generateWizardWork tool handler.
    interface GenerateWizardWorkInputArgs {
      project_id: string;
      prompt: string;
      author: string;
      email: string;
      outline_text?: string;
      has_technical_diagrams?: 'auto' | 'on' | 'off';
      has_tableofcontents?: 'auto' | 'on' | 'off';
      use_web_research?: 'auto' | 'on' | 'off';
      page_length?: string;
      questions_and_answers?: string; // JSON string
      mode?: 'deepwriter' | 'benchmark' | 'romance' | 'homework' | 'deepseek' | 'skunkworks';
      isDefault?: boolean;
      max_pages?: number;
      free_trial_mode?: 'true' | 'false';
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Generate content' implies a creation or processing action, but the description doesn't specify whether this is a read-only or destructive operation, what permissions are needed, or any rate limits. It lacks essential behavioral context for safe and effective use.

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 with no wasted words. It is appropriately sized and front-loaded, making it easy to parse quickly, though it lacks depth.

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 content generation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what 'content' entails, the format of the output, or any behavioral traits, leaving significant 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?

Schema description coverage is 100%, so the input schema already documents all parameters (api_key, is_default, project_id) with descriptions. The description adds no additional meaning beyond what the schema provides, such as explaining how parameters interact or their impact on content generation. Baseline 3 is appropriate when the schema does the heavy lifting.

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 'Generate content for a project' states a vague purpose with the verb 'generate' and resource 'content for a project', but it lacks specificity about what type of content or how it differs from sibling tools like createProject or updateProject. It doesn't clearly distinguish itself from other project-related operations.

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 createProject or updateProject. There are no explicit instructions, prerequisites, or context for usage, leaving the agent to infer based on 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