Skip to main content
Glama
huiseo
by huiseo

search_documents

Search Outline wiki documents by keyword to find relevant information quickly, with support for pagination to browse results efficiently.

Instructions

Search documents by keyword. Supports pagination.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
collectionIdNo
limitNo
offsetNo

Implementation Reference

  • The core handler function for the 'search_documents' tool. It calls the Outline API's '/documents.search' endpoint with the provided query parameters and formats the returned search results.
    async search_documents(args: SearchDocumentsInput) {
      const { data } = await apiCall(() =>
        apiClient.post<SearchResult[]>('/documents.search', {
          query: args.query,
          collectionId: args.collectionId,
          limit: args.limit,
          offset: args.offset,
        })
      );
      return formatSearchResults(data || [], baseUrl);
    },
  • Zod schema defining the input parameters for the 'search_documents' tool: query (required string), optional collectionId, limit, and offset.
    export const searchDocumentsSchema = z.object({
      query: z.string().min(1, 'Query is required'),
      collectionId: collectionId.optional(),
      limit: limit.default(10),
      offset,
    });
  • src/lib/tools.ts:36-40 (registration)
    Registers the 'search_documents' tool in the allTools array by calling createTool with its name, description, and schema key.
    createTool(
      'search_documents',
      'Search documents by keyword. Supports pagination.',
      'search_documents'
    ),
  • Maps the tool name 'search_documents' to its Zod schema in the toolSchemas lookup object.
    search_documents: searchDocumentsSchema,
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. It mentions 'Supports pagination,' which adds some context about handling large datasets, but fails to cover critical aspects like whether this is a read-only operation, authentication requirements, rate limits, error handling, or what the search results look like. For a search tool with zero annotation coverage, this is inadequate.

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 extremely concise with two short sentences: 'Search documents by keyword. Supports pagination.' It's front-loaded with the core purpose and wastes no words, 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 tool's complexity (4 parameters, 0% schema coverage, no annotations, no output schema), the description is insufficient. It lacks details on parameter meanings, behavioral traits, output format, and usage context. For a search operation that likely returns structured data, this leaves significant gaps for an AI agent to operate effectively.

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%, meaning none of the parameters (query, collectionId, limit, offset) are documented in the schema. The description only mentions 'keyword' (implied for 'query') and 'pagination' (implied for 'limit' and 'offset'), but doesn't explain the purpose of 'collectionId' or provide details on parameter usage. It adds minimal value beyond the bare schema.

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: 'Search documents by keyword.' It specifies the verb ('search') and resource ('documents'), making it easy to understand what the tool does. However, it doesn't differentiate from sibling tools like 'find_related' or 'get_document_id_from_title', which might also involve searching, so it's not fully distinguished.

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. It mentions 'Supports pagination,' which hints at usage for large result sets, but doesn't specify contexts, exclusions, or compare to siblings like 'find_related' or 'list_recent_documents.' This leaves the agent with minimal direction.

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-wiki-mcp'

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