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);
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. The description only states what the tool does at a high level ('find content semantically similar') but doesn't disclose behavioral traits like how similarity is calculated, whether it's a read-only operation, performance characteristics, or what the output format looks like. This leaves significant gaps for an AI agent to understand the tool's behavior.

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, clear sentence that efficiently conveys the core functionality without any wasted words. It's appropriately sized and front-loaded with the essential information.

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 semantic similarity search with 4 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain the algorithm, output format, or behavioral constraints, leaving the AI agent with significant uncertainty about how to interpret results or when the tool is appropriate.

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 schema already documents all four parameters thoroughly. The description adds no additional meaning beyond what's in the schema (e.g., it doesn't explain how 'reference_text' is used for semantic matching or what 'project_path' defaults to). With high schema coverage, the baseline score of 3 is appropriate as the description doesn't enhance parameter understanding.

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 tool's purpose as finding semantically similar content to given text, which is a specific verb+resource combination. However, it doesn't distinguish this from sibling tools like 'search_content' or 'holistic_search' that might also search for content, so it lacks sibling differentiation.

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. With multiple sibling tools that involve searching or analyzing content (e.g., 'search_content', 'holistic_search', 'find_duplicates'), there is no indication of when this semantic similarity search is preferred over other search methods.

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