get_requirements
Retrieve writing requirements for manuscripts, including word counts, deadlines, formatting rules, and audience specifications, to ensure project compliance.
Instructions
Get all requirements or filter by type
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | No | Path to manuscript directory (defaults to current directory) | |
| requirement_type | No | Filter by requirement type | |
| enforced_only | No | Show only enforced requirements |
Implementation Reference
- src/tools/WriterToolHandlers.ts:425-440 (handler)Primary handler function for the 'get_requirements' MCP tool. Parses input arguments and delegates execution to WritersAid.getRequirements().private async getRequirements(args: Record<string, unknown>) { const requirementType = args.requirement_type as | "word_count" | "citation_style" | "formatting" | "deadline" | "target_audience" | "tone" | "reading_level" | "chapter_count" | "other" | undefined; const enforcedOnly = args.enforced_only as boolean | undefined; return this.writersAid.getRequirements({ requirementType, enforcedOnly }); }
- MCP tool schema definition including input schema, description, and parameters for 'get_requirements'.{ name: "get_requirements", description: "Get all requirements or filter by type", 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: "Filter by requirement type", }, enforced_only: { type: "boolean", description: "Show only enforced requirements" }, }, }, },
- src/index.ts:73-75 (registration)Registers the tool list handler which provides the 'get_requirements' schema to MCP clients.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: writerToolDefinitions, }));
- src/index.ts:86-91 (registration)Instantiates WriterToolHandlers and calls handleTool() for tool execution in the MCP CallToolRequestHandler.const writersAid = new WritersAid({ projectPath }); const handlers = new WriterToolHandlers(writersAid); // Call the tool const result = await handlers.handleTool(name, args || {});
- Core database query helper that retrieves requirements by type from the SQLite database.getRequirementsByType(requirementType: RequirementType): WritingRequirement[] { const rows = this.db .prepare( `SELECT id, requirement_type, description, value, enforced, created_at FROM writing_requirements WHERE requirement_type = ? ORDER BY created_at DESC` ) .all(requirementType) as RequirementRow[]; return rows.map((row) => this.rowToRequirement(row)); }