Skip to main content
Glama

get_tool_context

Retrieve tool-specific rules, syntax, and preferences for any tool. Automatically injects context across chat sessions, eliminating need to re-establish in each new conversation.

Instructions

Get complete context (rules, syntax, preferences) for a specific tool

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tool_nameYesTool name or category (e.g. "git", "dokuwiki", "terraform")

Implementation Reference

  • Engine.matchContexts() delegates to ContextMatcher.match() to find contexts matching the tool query.
    matchContexts(query: ContextQuery): ContextMatch[] {
      return this.contextMatcher.match(this.contexts, query);
    }
  • ContextMatcher.match() performs the core context matching logic: filtering by categories, priority, and tool pattern matching (exact, wildcard, prefix).
    match(
      contexts: Map<string, Context>,
      query: ContextQuery,
    ): ContextMatch[] {
      const minPriority = PRIORITY_ORDER[query.min_priority ?? 'low'] ?? 1;
      const matches: ContextMatch[] = [];
    
      for (const context of contexts.values()) {
        // Category filter
        if (
          query.categories?.length &&
          !query.categories.includes(context.tool_category)
        ) {
          continue;
        }
    
        // Priority filter
        const priority = context.metadata.priority ?? 'medium';
        if ((PRIORITY_ORDER[priority] ?? 2) < minPriority) continue;
    
        // Tool pattern matching
        const matchedPattern = this.findMatchingTool(
          context.metadata.applies_to_tools,
          query.tool,
        );
        if (!matchedPattern) continue;
    
        matches.push({ context, matched_pattern: matchedPattern, priority });
      }
    
      return matches.sort(
        (a, b) =>
          (PRIORITY_ORDER[b.priority] ?? 2) - (PRIORITY_ORDER[a.priority] ?? 2),
      );
    }
  • Type definition for ContextQuery used as input to matchContexts.
    export interface ContextQuery {
      /** The tool being used, e.g. "bash:git", "memory", "docker". */
      tool: string;
    
      /** Optional: only return contexts with these categories. */
      categories?: string[];
    
      /** Optional: only return contexts with this priority or higher. */
      min_priority?: 'high' | 'medium' | 'low';
    }
Behavior3/5

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

No annotations provided; the description discloses that the tool returns 'rules, syntax, preferences' but does not mention safety (e.g., read-only) or any side effects. Minimal but adequate.

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?

Single, concise sentence with no extraneous words, effectively front-loading the core purpose.

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?

Given the simple interface (one parameter, no output schema), the description sufficiently explains the tool's return content, though it could hint at the output format.

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% and the description does not add extra meaning to the 'tool_name' parameter beyond the schema's existing example and description, meeting the baseline.

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 uses a specific verb ('Get') and resource ('complete context') and distinguishes from siblings like 'get_syntax_rules' by mentioning 'rules, syntax, preferences' as a comprehensive set.

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

Usage Guidelines3/5

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

No explicit guidance on when to use this tool versus siblings like 'get_syntax_rules' or 'list_available_contexts', though the word 'complete' implies it is the comprehensive version.

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/doobidoo/MCP-Context-Provider'

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