Skip to main content
Glama

find_related_sections

Locate manuscript sections with similar content to reference text using semantic analysis for writing consistency and research.

Instructions

Find content semantically similar to given text

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathNoPath to manuscript directory (defaults to current directory)
reference_textYesText to find related content for
limitNoMaximum results
exclude_fileNoFile to exclude from results

Implementation Reference

  • The core handler function implementing the 'find_related_sections' tool logic. It extracts 'reference_text' and 'limit' from the input arguments and performs a semantic search using the underlying WritersAid instance's searchContent method to find related sections.
    private async findRelatedSections(args: Record<string, unknown>) { const referenceText = args.reference_text as string; const limit = (args.limit as number) || 5; // Use search with the reference text return this.writersAid.searchContent(referenceText, { limit }); }
  • The schema definition for the 'find_related_sections' tool, including name, description, input schema with properties like project_path, reference_text, limit, exclude_file, and required fields.
    { name: "find_related_sections", description: "Find content semantically similar to given text", inputSchema: { type: "object", properties: { project_path: { type: "string", description: "Path to manuscript directory (defaults to current directory)" }, reference_text: { type: "string", description: "Text to find related content for" }, limit: { type: "number", description: "Maximum results", default: 5 }, exclude_file: { type: "string", description: "File to exclude from results" }, }, required: ["reference_text"], },
  • The switch case statement in the handleTool method that registers and dispatches calls to the findRelatedSections handler for the 'find_related_sections' tool.
    case "find_related_sections": return this.findRelatedSections(args);

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