Skip to main content
Glama

bear_context_set_prefix

Idempotent

Change the tag prefix for context notes, retagging all existing notes with the new prefix while preserving sub-tags. Solves aligning qualifier tags with a broader naming scheme.

Instructions

Change the context library's tag prefix and re-tag every Bear note that currently uses the old prefix. Sub-tags are preserved — #context/research becomes #<new>/research. Updates both the markdown body and the CloudKit tag index, and persists the new prefix to the context config. Useful when aligning the qualifier tag with a broader naming scheme like Johnny Decimal (e.g. '10-projects'). Run bear_context_sync afterwards to refresh the library.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
new_prefixYesNew tag prefix without the leading #. Example: '10-projects'.

Implementation Reference

  • buildArgs function that builds the CLI arguments for the 'bear_context_set_prefix' tool. It returns ['context', 'set-prefix', String(input.new_prefix), '--json'] which calls the bcli command to change the context library's tag prefix.
      buildArgs: (input) => [
        "context",
        "set-prefix",
        String(input.new_prefix),
        "--json",
      ],
    },
  • Input schema for bear_context_set_prefix, defining a required 'new_prefix' string parameter (the new tag prefix without leading #).
    inputSchema: {
      type: "object" as const,
      properties: {
        new_prefix: {
          type: "string",
          description:
            "New tag prefix without the leading #. Example: '10-projects'.",
        },
      },
      required: ["new_prefix"],
    },
  • Registration of the 'bear_context_set_prefix' tool in the tools registry. It's a key in the `tools` Record exported from tools.ts, containing both the tool metadata and the buildArgs function.
    bear_context_set_prefix: {
      tool: {
        name: "bear_context_set_prefix",
        description:
          "Change the context library's tag prefix and re-tag every Bear note that currently uses the old prefix. Sub-tags are preserved — `#context/research` becomes `#<new>/research`. Updates both the markdown body and the CloudKit tag index, and persists the new prefix to the context config. Useful when aligning the qualifier tag with a broader naming scheme like Johnny Decimal (e.g. '10-projects'). Run `bear_context_sync` afterwards to refresh the library.",
        inputSchema: {
          type: "object" as const,
          properties: {
            new_prefix: {
              type: "string",
              description:
                "New tag prefix without the leading #. Example: '10-projects'.",
            },
          },
          required: ["new_prefix"],
        },
        annotations: {
          readOnlyHint: false,
          destructiveHint: false,
          idempotentHint: true,
        },
      },
      buildArgs: (input) => [
        "context",
        "set-prefix",
        String(input.new_prefix),
        "--json",
      ],
    },
  • The MCP server registers all tools (including bear_context_set_prefix) by exporting their Tool definitions via ListToolsRequestSchema and invoking them via CallToolRequestSchema.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: Object.values(tools).map((t) => t.tool),
    }));
Behavior5/5

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

The description details sub-tag preservation, updates to both markdown and CloudKit, and config persistence, adding significant value beyond the annotations which only indicate idempotency.

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 concise yet comprehensive, with each sentence serving a distinct purpose: purpose, behavior, usage scenario, and follow-up. No redundant information.

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

Completeness5/5

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

Despite having only one parameter and no output schema, the description covers all necessary aspects: what it does, how it behaves, and a suggested post-action, making it fully informative for an agent.

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 coverage is 100% with a clear description and example. The tool description repeats the example but does not add new semantic information beyond the schema.

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 tool changes the context library's tag prefix and re-tags notes. It distinguishes from siblings by specifying a unique bulk re-tagging operation.

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 provides a usage scenario (aligning with naming schemes like Johnny Decimal) and suggests a follow-up action (bear_context_sync). However, it does not explicitly state when not to use or mention alternatives.

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/KuvopLLC/better-bear'

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