find_broken_links
Detect broken internal and external links in markdown manuscripts to maintain content integrity and improve user experience by identifying and addressing non-functional URLs.
Instructions
Detect broken internal and external links
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | No | Path to manuscript directory (defaults to current directory) | |
| check_external | No | Check external links | |
| scope | No | File scope pattern | |
| limit | No | Maximum results |
Implementation Reference
- src/tools/WriterToolHandlers.ts:210-216 (handler)The primary handler function for the 'find_broken_links' MCP tool. It processes input arguments, applies pagination limits, and delegates to the WritersAid.checkLinks method for core logic.private async findBrokenLinks(args: Record<string, unknown>) { const checkExternal = (args.check_external as boolean) || false; const scope = args.scope as string | undefined; const limit = resolvePaginationLimit("find_broken_links", args.limit as number | undefined); return this.writersAid.checkLinks({ checkExternal, scope, limit }); }
- The JSON schema definition for the tool, specifying input parameters, types, descriptions, and defaults for MCP validation.{ name: "find_broken_links", description: "Detect broken internal and external links", inputSchema: { type: "object", properties: { project_path: { type: "string", description: "Path to manuscript directory (defaults to current directory)" }, check_external: { type: "boolean", description: "Check external links", default: false }, scope: { type: "string", description: "File scope pattern" }, limit: { type: "number", description: "Maximum results", default: 50 }, }, }, },
- src/tools/WriterToolHandlers.ts:38-39 (registration)The tool registration in the central handleTool switch dispatcher, mapping the tool name to its handler method.case "find_broken_links": return this.findBrokenLinks(args);
- src/utils/pagination.ts:18-18 (helper)Pagination limit configuration used by the handler to enforce safe result limits and prevent token overflow.find_broken_links: { default: 50, max: 200 },