Skip to main content
Glama

get_syntax_rules

Retrieve syntax-specific rules and best practices for any tool category to maintain consistent context across chat sessions.

Instructions

Get syntax-specific rules for a tool category

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tool_nameYesTool name or category

Implementation Reference

  • Zod schema for Context — syntax_rules is defined as z.record(z.unknown()).optional() as a loosely-validated domain-specific section.
    export const ContextSchema = z
      .object({
        tool_category: z.string().min(1),
        description: z.string().min(1),
        auto_convert: z.boolean().default(false),
        metadata: ContextMetadataSchema,
    
        // Triggers (optional)
        auto_store_triggers: z.record(StoreTriggerSchema).optional(),
        auto_retrieve_triggers: z.record(RetrieveTriggerSchema).optional(),
        auto_corrections: z.record(AutoCorrectionSchema).optional(),
        session_initialization: SessionInitializationSchema.optional(),
    
        // Domain-specific sections validated loosely
        syntax_rules: z.record(z.unknown()).optional(),
        preferences: z.record(z.unknown()).optional(),
        workflow_patterns: z.record(z.unknown()).optional(),
        best_practices: z.record(z.unknown()).optional(),
        hooks: z.record(z.unknown()).optional(),
        common_commands: z.record(z.string()).optional(),
      })
      .passthrough(); // Allow additional domain-specific keys
  • Engine.matchContexts() resolves contexts matching a given tool query, used by the get_syntax_rules handler.
    matchContexts(query: ContextQuery): ContextMatch[] {
      return this.contextMatcher.match(this.contexts, query);
    }
  • TypeScript interface for Context — syntax_rules field is typed as Record<string, unknown> | undefined.
    export interface Context {
      /** Primary tool category identifier, e.g. "git", "memory", "docker". */
      tool_category: string;
    
      /** Human-readable description. */
      description: string;
    
      /** Whether to auto-apply corrections from auto_corrections rules. */
      auto_convert: boolean;
    
      /** Context metadata for matching and versioning. */
      metadata: ContextMetadata;
    
      // --- Triggers (optional) ---
    
      /** Pattern-based auto-store triggers for memory. */
      auto_store_triggers?: Record<string, StoreTrigger>;
    
      /** Pattern-based auto-retrieve triggers from memory. */
      auto_retrieve_triggers?: Record<string, RetrieveTrigger>;
    
      /** Regex-based text auto-corrections. */
      auto_corrections?: Record<string, AutoCorrection>;
    
      /** Session initialization configuration. */
      session_initialization?: SessionInitialization;
    
      // --- Domain-specific content (opaque to engine) ---
    
      /** Tool-specific syntax rules (format varies by domain). */
      syntax_rules?: Record<string, unknown>;
    
      /** Tool-specific preferences. */
      preferences?: Record<string, unknown>;
    
      /** Workflow patterns and templates. */
      workflow_patterns?: Record<string, unknown>;
Behavior2/5

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

No annotations provided, so the description needs to disclose behavior. It only states what it gets, not side effects, auth needs, rate limits, or return format. Minimal transparency.

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?

Extremely concise: a single sentence of 7 words that is front-loaded and to the point. No extraneous information.

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

Completeness2/5

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

With no output schema, the description fails to explain what 'syntax-specific rules' means or the structure of the response. Inadequate for an agent to fully understand the tool's output.

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 description coverage is 100%, so the schema already defines the parameter. The description adds no extra meaning beyond 'tool name or category', hence no additional value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it retrieves 'syntax-specific rules for a tool category', which is a specific verb and resource. However, it does not differentiate from sibling tools like 'get_tool_context', making it slightly generic.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus its siblings or alternatives. There is no mention of prerequisites, when-not-to-use, or preferred contexts.

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