Skip to main content
Glama
Touexe
by Touexe

manage_collection

Idempotent

Create and update PocketBase collection schemas by specifying fields, API rules, indexes, and view queries for base, auth, or view collections.

Instructions

USE WHEN you need to create or modify a collection schema.

EXAMPLES:

  • Create base: manage_collection(action="create", name="posts", fields=[{"name": "title", "type": "text", "required": True}])

  • Create view: manage_collection(action="create", name="post_stats", collection_type="view", view_query="SELECT id, title FROM posts")

  • Update rules: manage_collection(action="update", name="posts", api_rules={"list": "@request.auth.id != ''"})

NEXT STEPS: describe_collection to verify, find_records or write_record to use.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesCollection name.
actionYesWhether to create a new collection or update an existing one.
fieldsNoField definitions. See PocketBase schema for field shapes.
indexesNoIndex definitions.
api_rulesNoAPI rules: {list, view, create, update, delete}.
view_queryNoSQL query (for type='view' only). Validated before creation.
collection_typeNoCollection type (for create only).base

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.2/5.0
Behavior3/5

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

The description discloses the core mutating behavior ('create or modify a collection schema') and shows example effects, but it does not explain subtler side effects such as whether an update replaces existing fields or API rules. With only idempotentHint=true in annotations and no destructive/readOnly hints, a bit more behavioral context would be valuable. There is no contradiction with the annotation.

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?

Each section earns its place: USE WHEN gives the trigger, examples show valid parameter combinations, and NEXT STEPS gives the post-invocation workflow. The formatting is scannable and contains no redundant schema prose.

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

Completeness4/5

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

For a tool with seven parameters, enums, and multiple collection types, the examples cover the main create/update paths and provide verification follow-up. Since an output schema exists, return-value explanation is unnecessary. The main minor gap is that auth collections are not exemplified, especially with manage_auth as a sibling.

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 coverage is already 100%, but the examples add real compositional meaning: fields for base collections, collection_type/view_query for views, and api_rules for updates. This helps an agent build valid parameter sets more effectively than the bare schema descriptions alone.

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 opens with 'USE WHEN you need to create or modify a collection schema,' naming a concrete action and resource. The examples for create base, create view, and update rules clearly distinguish this from siblings like describe_collection, find_records, and write_record, especially via the NEXT STEPS guidance.

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?

It explicitly states when to use the tool with 'USE WHEN' and gives a follow-up workflow: 'describe_collection to verify, find_records or write_record to use.' It does not explicitly say when not to use it or name alternatives for read-only schema inspection, so it stops short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.