Skip to main content
Glama

detect_chains

Automatically identifies and records recurring sequential tool patterns from observation logs, enabling instinct to learn chains without explicit configuration.

Instructions

Mine the observation log to auto-create "seq:A->B" patterns for recurring chains.

    Scans the confidence log for pairs of patterns observed close in
    time, and creates a new sequence pattern for any pair seen enough
    times. This is how instinct learns tool chains without being told
    what to track.

    Safe to run periodically. Does not overwrite existing chains; only
    appends confidence for new pairs.

    Args:
        window_minutes: Maximum gap between two observations to consider
            them sequential. Smaller (1-2) = tight chains only. Larger
            (10+) = loose associations. Default 5 is a good balance.
        min_occurrences: Threshold for recording a chain. A pair must
            appear at least this many times in the log before it becomes
            a pattern. Default 3 filters out one-off coincidences.

    Returns:
        Dict with keys: "chains_created" (int — new patterns added),
        "chains_reinforced" (int — existing patterns whose confidence
        rose), "candidates_seen" (int — raw pair count before threshold).
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
window_minutesNo
min_occurrencesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

Despite no annotations, the description fully discloses behavior: scans confidence log, pairs patterns close in time, only appends confidence, safe to run periodically, and explains the algorithm's non-destructive nature. This exceeds what annotations would typically provide.

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?

Well-structured with clear sections: overview, safety note, parameter explanations, return value. Slightly verbose in places but front-loaded with key information. Could tighten minor phrasing.

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 the tool's simplicity (2 optional params, no annotations, output schema described in full), this description provides comprehensive coverage. No missing details about purpose, usage, parameters, or return values.

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?

Despite 0% schema coverage, the description explains both parameters in detail, including defaults, practical guidance (e.g., 'Tight chains only' for smaller window), and thresholds. Adds significant meaning beyond the bare 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?

Description clearly identifies the tool's purpose: mining observation logs to auto-create sequence patterns (A->B). It distinguishes from siblings by specifying it creates new patterns without overwriting, which is unique among sibling tools like 'observe' or 'alias_pattern'.

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?

States 'Safe to run periodically' and 'Does not overwrite existing chains; only appends', providing context for when to use it. However, does not explicitly mention when to avoid using or compare with alternatives like 'trending' or 'suggest'.

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