Skip to main content
Glama

detect_chains

Analyzes observation logs to identify and record recurring sequential patterns between tools, enabling automated learning of behavioral chains based on repeated usage patterns.

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?

With no annotations provided, the description carries the full burden and does so effectively. It discloses key behavioral traits: safety ('safe to run periodically'), non-destructive behavior ('does not overwrite existing chains; only appends confidence for new pairs'), and the learning mechanism ('how instinct learns tool chains without being told what to track'). This goes beyond what minimal schema provides.

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 appropriately sized and well-structured. It starts with the core purpose, explains the mechanism, provides behavioral context, details parameters with examples, and specifies return values. Every sentence adds value with no wasted words, and information is front-loaded for quick understanding.

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 complexity (automated pattern discovery), lack of annotations, and 0% schema description coverage, the description is remarkably complete. It covers purpose, mechanism, behavioral traits, parameter semantics with defaults and guidance, and return values (though an output schema exists, it helpfully explains the return structure). This provides all necessary context for effective 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?

The description adds substantial meaning beyond the input schema, which has 0% description coverage. It explains both parameters in detail: 'window_minutes' defines the maximum time gap for sequential observations with guidance on values (1-2 for tight chains, 10+ for loose associations, default 5 as balance), and 'min_occurrences' sets the threshold for recording with rationale (default 3 filters out one-off coincidences). This fully compensates for the schema gap.

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's purpose with specific verbs ('mine', 'auto-create', 'scans', 'creates') and resources ('observation log', 'confidence log', 'seq:A->B patterns', 'recurring chains'). It distinguishes this from siblings by explaining this is how 'instinct learns tool chains without being told what to track', unlike other tools that might manually create or manage patterns.

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 clear context for when to use this tool ('safe to run periodically', 'for recurring chains'), but does not explicitly state when not to use it or name specific alternatives among the sibling tools. It implies usage for automated pattern discovery rather than manual creation or management.

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/yakuphanycl/instinct'

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