Skip to main content
Glama

import_patterns

Bulk-import multiple patterns at once, incrementing existing confidence without lowering. Avoids looping observe() calls. Returns counts of imported, updated, and errors.

Instructions

Bulk-insert many patterns in a single call; faster than looping observe().

    Each input row is routed through observe() so existing patterns
    have their confidence incremented rather than overwritten, matching
    single-call observe() semantics. If an input row specifies a
    "confidence" higher than the current stored value, the record is
    raised to that target value (never lowered). Rows with missing or
    empty "pattern" are skipped.

    For importing a CLAUDE.md Markdown file use import_claude_md()
    which handles the backtick-wrapped pattern parsing for you. Run
    consolidate() after a large import so downstream exports see the
    fresh promotions.

    Args:
        patterns: List of dicts. Each dict requires "pattern" (str key
            with category prefix). Optional keys:
              - "category": "sequence" | "preference" | "fix_pattern"
                | "combo". Defaults to "sequence" if omitted.
              - "source": str origin tag (e.g. "codex", "manual").
              - "project": str fingerprint. Empty = global.
              - "metadata": dict of free-form JSON-serializable data.
              - "explain": str human-readable note (truncated at the
                store-configured max length).
              - "confidence": int starting count. Defaults to 1. If
                greater than the current stored confidence for a
                pre-existing pattern, the record is raised to this
                value.

    Returns:
        {"imported": int, "updated": int, "errors": int, "hint": str}

        "imported" = rows that created a new pattern. "updated" =
        rows that reinforced an existing pattern. "errors" = rows
        skipped because "pattern" was missing/empty or observe() raised
        (count only — see server logs for per-row reasons). "hint"
        points to consolidate() as the recommended follow-up.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patternsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

No annotations provided, so description carries full burden. Explains behavior: each row routed through observe(), confidence incremented but never lowered, rows with missing pattern skipped. Discloses mutation and return structure with counts and hint.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is well-structured with sections for purpose, parameters, and returns. Front-loaded with main action. Slightly verbose but every sentence adds value. Could be trimmed slightly without loss.

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?

Given tool complexity (bulk insertion with merging logic) and no annotations, description covers all essential aspects: behavior, parameter details, return format, and relationship to siblings. Output schema described in text. Complete for agent use.

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

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema has 0% coverage (only specifies array of objects with no properties). Description fully compensates by detailing required keys ('pattern'), optional keys with defaults and types (category, source, project, metadata, explain, confidence), and their semantics.

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?

Description clearly states 'Bulk-insert many patterns in a single call; faster than looping observe()', specifies verb and resource. Distinguishes from sibling tools like observe and import_claude_md by noting performance advantage and specific use case for Markdown imports.

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

Usage Guidelines5/5

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

Explicitly tells when to use (bulk insert, faster than observe) and when not (use import_claude_md for Markdown files). Recommends consolidate() after large import, providing clear context and 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/WRG-11/instinct'

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