Skip to main content
Glama
avarant

Typesense MCP Server

truncate_collection

Delete all documents in a collection while preserving its schema. This process retrieves the schema, deletes the collection, and recreates it with the same structure, ensuring data is cleared without altering the schema design.

Instructions

Truncates a collection by deleting all documents but keeping the schema.
Achieved by retrieving schema, deleting collection, and recreating it.

Args:
    ctx (Context): The MCP context.
    collection_name (str): The name of the collection to truncate.

Returns:
    str: A success or error message string.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collection_nameYes
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses the destructive nature ('deleting all documents') and the implementation method ('retrieving schema, deleting collection, and recreating it'), which adds useful context about potential side effects (e.g., temporary unavailability). However, it lacks details on permissions, error handling, or performance implications.

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 front-loaded with the core purpose in the first sentence, followed by implementation details and parameter/return explanations. Every sentence earns its place by adding value, with no redundant or verbose content, making it highly efficient.

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?

For a destructive tool with no annotations and no output schema, the description is adequate but has gaps. It covers the purpose, method, and parameters, but lacks details on return values beyond 'success or error message,' error conditions, or integration with sibling tools. Given the complexity, it could benefit from more behavioral context.

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

Parameters4/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. It explains that 'collection_name' is 'the name of the collection to truncate,' which adds essential meaning beyond the schema's basic type. However, it doesn't provide examples, constraints, or format details for the parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('truncates a collection'), the resource affected ('collection'), and the precise effect ('deleting all documents but keeping the schema'). It distinguishes from sibling tools like delete_collection (which removes the entire collection) and delete_document (which removes individual documents).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context through the phrase 'deleting all documents but keeping the schema,' suggesting this tool is for resetting document content while preserving structure. However, it doesn't explicitly state when to use this versus alternatives like delete_collection (for full removal) or manual document deletion, nor does it mention prerequisites or exclusions.

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

Related 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/avarant/typesense-mcp-server'

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