Skip to main content
Glama

set_requirement

Store publisher or style requirements like word count, citation style, formatting, deadlines, and target audience for manuscript projects to ensure writing compliance.

Instructions

Store a publisher or style requirement

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathNoPath to manuscript directory (defaults to current directory)
requirement_typeYesType of requirement
descriptionYesDescription of the requirement
valueNoTarget value (e.g., '50000' for word count)
enforcedNoWhether this requirement is enforced

Implementation Reference

  • Primary handler that processes 'set_requirement' tool arguments and delegates to WritersAid.setRequirement for execution.
    private async setRequirement(args: Record<string, unknown>) {
      const requirementType = args.requirement_type as
        | "word_count"
        | "citation_style"
        | "formatting"
        | "deadline"
        | "target_audience"
        | "tone"
        | "reading_level"
        | "chapter_count"
        | "other";
      const description = args.description as string;
      const value = args.value as string | undefined;
      const enforced = (args.enforced as boolean) || false;
    
      return this.writersAid.setRequirement({
        requirementType,
        description,
        value,
        enforced,
      });
    }
  • Defines the input schema, parameters, and metadata for the 'set_requirement' tool.
    {
      name: "set_requirement",
      description: "Store a publisher or style requirement",
      inputSchema: {
        type: "object",
        properties: {
          project_path: { type: "string", description: "Path to manuscript directory (defaults to current directory)" },
          requirement_type: {
            type: "string",
            enum: ["word_count", "citation_style", "formatting", "deadline", "target_audience", "tone", "reading_level", "chapter_count", "other"],
            description: "Type of requirement",
          },
          description: { type: "string", description: "Description of the requirement" },
          value: { type: "string", description: "Target value (e.g., '50000' for word count)" },
          enforced: { type: "boolean", description: "Whether this requirement is enforced", default: false },
        },
        required: ["requirement_type", "description"],
      },
    },
  • src/index.ts:73-75 (registration)
    Registers the list of available tools including 'set_requirement' via writerToolDefinitions.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: writerToolDefinitions,
    }));
  • Core helper method in WritersAid that invokes RequirementsManager to persist the requirement.
    setRequirement(options: {
      requirementType:
        | "word_count"
        | "citation_style"
        | "formatting"
        | "deadline"
        | "target_audience"
        | "tone"
        | "reading_level"
        | "chapter_count"
        | "other";
      description: string;
      value?: string;
      enforced?: boolean;
    }) {
      const requirement = this.requirementsManager.addRequirement({
        requirementType: options.requirementType,
        description: options.description,
        value: options.value,
        enforced: options.enforced || false,
      });
    
      return {
        id: requirement.id,
        requirementType: requirement.requirementType,
        description: requirement.description,
        value: requirement.value,
        enforced: requirement.enforced,
      };
    }
  • Database insertion logic that stores the requirement in the SQLite 'writing_requirements' table.
    addRequirement(
      requirement: Omit<WritingRequirement, "id" | "createdAt">
    ): WritingRequirement {
      const now = Date.now();
      const newRequirement: WritingRequirement = {
        id: nanoid(),
        ...requirement,
        createdAt: now,
      };
    
      this.db
        .prepare(
          `INSERT INTO writing_requirements
           (id, requirement_type, description, value, enforced, created_at)
           VALUES (?, ?, ?, ?, ?, ?)`
        )
        .run(
          newRequirement.id,
          newRequirement.requirementType,
          newRequirement.description,
          newRequirement.value || null,
          newRequirement.enforced ? 1 : 0,
          newRequirement.createdAt
        );
    
      return newRequirement;
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but only states 'Store' without clarifying behavioral aspects. It doesn't mention if this is a create/update operation, permission requirements, side effects, or response format, which are critical 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 with zero wasted words. It's front-loaded and appropriately sized for the tool's complexity, making it easy to parse quickly.

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?

For a mutation tool with no annotations and no output schema, the description is incomplete. It lacks details on behavior, error handling, or return values, leaving significant gaps for an AI agent to understand how to invoke it correctly.

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 parameters are well-documented in the schema. The description adds no additional meaning beyond implying storage of requirements, aligning with the baseline score when schema does the heavy lifting.

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 ('Store') and resource ('publisher or style requirement'), making the purpose evident. However, it doesn't differentiate from sibling tools like 'get_requirements' or 'add_style_decision', which would require more specificity about when to use each.

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?

No guidance is provided on when to use this tool versus alternatives like 'get_requirements' (for retrieval) or 'add_style_decision' (for style-related actions). The description lacks context about prerequisites, timing, or exclusions, leaving usage unclear.

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/xiaolai/claude-writers-aid-mcp'

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