Skip to main content
Glama

anytype_search_objects

Search for objects across all spaces or within a specific space in Anytype, with options to filter by object type and limit results.

Instructions

Busca objetos en todos los espacios o en un espacio específico

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoTexto a buscar
space_idNoID del espacio específico (opcional)
typesNoTipos de objetos a filtrar
limitNoLímite de resultados

Implementation Reference

  • The core handler function that executes the 'anytype_search_objects' tool. It handles search queries either globally or within a specific space by constructing the appropriate Anytype API endpoint and request body, including support for types filtering, sorting, pagination, and returns the formatted response.
    export async function handleSearchObjects(args: any) {
      const { space_id, query, types, limit = 20, offset = 0 } = args;
      
      let endpoint;
      let requestBody: any;
      
      if (space_id) {
        // Search within a specific space - using correct API v1 endpoint
        endpoint = `/v1/spaces/${space_id}/search?offset=${offset}&limit=${limit}`;
        
        // For space search, use property_key according to API docs
        requestBody = {
          query: query || '',
          sort: {
            direction: 'desc',
            property_key: 'last_modified_date'
          }
        };
        
        // Add types filter if provided (no prefix needed for space search)
        if (types && types.length > 0) {
          requestBody.types = types;
        }
      } else {
        // Global search across all spaces - using correct API v1 endpoint
        endpoint = `/v1/search?offset=${offset}&limit=${limit}`;
        
        // For global search, use property_key according to API docs
        requestBody = {
          query: query || '',
          sort: {
            direction: 'desc',
            property_key: 'last_modified_date'
          }
        };
        
        // Add types filter if provided
        if (types && types.length > 0) {
          requestBody.types = types;
        }
      }
      
      const response = await makeRequest(endpoint, {
        method: 'POST',
        body: JSON.stringify(requestBody),
      });
      return { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] };
    }
  • The tool schema definition including name, description, and inputSchema for validation of parameters like query, space_id, types, and limit.
      name: 'anytype_search_objects',
      description: 'Busca objetos en todos los espacios o en un espacio específico',
      inputSchema: {
        type: 'object',
        properties: {
          query: { type: 'string', description: 'Texto a buscar' },
          space_id: { type: 'string', description: 'ID del espacio específico (opcional)' },
          types: { type: 'array', items: { type: 'string' }, description: 'Tipos de objetos a filtrar' },
          limit: { type: 'number', description: 'Límite de resultados', default: 20 },
        },
      },
    },
  • src/index.ts:122-123 (registration)
    Registration of the tool handler in the main switch statement that dispatches tool calls to the appropriate handler function.
    case 'anytype_search_objects':
      return await handleSearchObjects(args);
  • src/index.ts:85-93 (registration)
    Inclusion of objectTools (containing the schema) into the full list of available tools returned by ListToolsRequest.
    const tools = [
      ...spaceTools,
      ...objectTools,
      ...propertyTools,
      ...typeTools,
      ...tagTools,
      ...templateTools,
      ...listTools,
    ];
  • src/index.ts:16-16 (registration)
    Import of the objectTools array which includes the schema for anytype_search_objects.
    import { objectTools } from './tools/objects.js';
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions searching across spaces but doesn't disclose behavioral traits like: whether this is a read-only operation, how results are returned (format, pagination), performance characteristics, authentication requirements, or error conditions. For a search tool with 4 parameters and no annotations, this is a significant gap in behavioral context.

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 in Spanish that clearly states the core functionality. It's appropriately sized for a search tool and front-loads the essential information without unnecessary elaboration. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 4 parameters with 100% schema coverage but no annotations and no output schema, the description is minimally adequate. It covers the basic purpose but lacks important context about behavioral traits, result format, and differentiation from sibling tools. For a search operation that likely returns complex results, more guidance would be helpful despite the good parameter documentation.

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 4 parameters thoroughly. The description adds minimal value beyond the schema - it implies the 'space_id' parameter allows searching in specific spaces versus all spaces, but doesn't provide additional context about parameter interactions, search syntax, or result ordering. Baseline 3 is appropriate when the schema does the heavy lifting.

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: 'Busca objetos en todos los espacios o en un espacio específico' (Search objects in all spaces or in a specific space). It specifies the verb 'busca' (search) and resource 'objetos' (objects), with scope clarification. However, it doesn't explicitly differentiate from sibling tools like 'anytype_get_list_objects' or 'anytype_list_objects', which appear to be similar listing operations.

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 doesn't mention sibling tools like 'anytype_get_list_objects' or 'anytype_list_objects', nor does it explain when search functionality is preferred over simple listing. There's no context about prerequisites, constraints, or typical use cases.

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/cryptonahue/mcp-anytype'

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