Skip to main content
Glama
huiseo

Outline Wiki MCP Server

by huiseo

find_related

Discover semantically related documents in Outline wiki to expand research, find connections, and gather context for any document.

Instructions

Find documents semantically related to a specific document.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
documentIdYes
limitNo

Implementation Reference

  • The handler function that implements the find_related tool logic: fetches the target document, performs a semantic search using brain.search on its title and initial text, filters out the source document, and returns a list of related documents with titles, URLs, and excerpts.
    async find_related(args: { documentId: string; limit?: number }) {
      if (!brain.isEnabled()) {
        return { error: ERROR_MESSAGES.SMART_FEATURES_DISABLED };
      }
    
      // Fetch document
      const { data } = await apiCall(() =>
        apiClient.post<OutlineDocument>('/documents.info', { id: args.documentId })
      );
    
      if (!data.text) {
        return { error: ERROR_MESSAGES.NO_CONTENT_TO_ANALYZE };
      }
    
      // Search for similar documents
      const results = await brain.search(data.title + ' ' + data.text.substring(0, 500), args.limit || 5);
    
      // Filter out the source document
      const related = results.filter((r) => !r.id.startsWith(args.documentId));
    
      return {
        documentId: data.id,
        title: data.title,
        related: related.map((r) => ({
          title: r.title,
          url: r.url,
          excerpt: r.text.substring(0, 200) + '...',
        })),
      };
    },
  • Zod schema definition for the find_related tool input: requires documentId and optional limit (default 5).
    export const findRelatedSchema = z.object({
      documentId,
      limit: limit.default(5).optional(),
    });
  • Registration of the find_related tool in the allTools array using createTool, providing name, description, and schema reference.
    createTool(
      'find_related',
      'Find documents semantically related to a specific document.',
      'find_related'
    ),
  • Mapping of 'find_related' to its schema in the central toolSchemas record used for tool definitions.
    find_related: findRelatedSchema,
  • TypeScript type definition for find_related input inferred from the Zod schema.
    export type FindRelatedInput = z.infer<typeof findRelatedSchema>;
Behavior1/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It fails to describe how 'semantically related' is determined, what the output format looks like, whether results are ranked, if there are rate limits, or what permissions are required. For a tool with no annotation coverage, this leaves critical behavioral aspects unspecified.

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 with the core purpose and uses precise terminology ('semantically related'). Every word earns its place, 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?

Given the complexity of semantic search, lack of annotations, 0% schema coverage, and no output schema, the description is incomplete. It doesn't address how similarity is measured, result format, error conditions, or performance characteristics. For a tool that likely involves non-trivial computation, this leaves too many unknowns for reliable agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate but adds no parameter information. It doesn't explain what 'documentId' refers to (e.g., UUID, title, path) or how 'limit' affects results (e.g., top-N matches). With 2 parameters completely undocumented in both schema and description, this creates significant ambiguity for the agent.

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 verb ('find') and resource ('documents semantically related to a specific document'), making the purpose understandable. It distinguishes from obvious siblings like 'search_documents' by specifying semantic relationships rather than keyword-based searches. However, it doesn't explicitly differentiate from 'get_document_backlinks' which might also find related documents.

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 like 'search_documents' or 'get_document_backlinks'. It doesn't mention prerequisites, exclusions, or specific contexts where this tool is preferred. The agent must infer usage from the name and description alone.

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/huiseo/outline-smart-mcp'

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