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
| Name | Required | Description | Default |
|---|---|---|---|
| tool_name | Yes | Tool name or category |
Implementation Reference
- src/schema/context.schema.ts:88-109 (schema)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 - src/engine/engine.ts:190-192 (helper)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); } - src/types/context.ts:144-180 (helper)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>;