Skip to main content
Glama

get_syntax_rules

Retrieve syntax rules and preferences for specific tools to maintain consistent formatting and best practices across conversations.

Instructions

Get syntax-specific rules for a tool category

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tool_nameYesTool name or category

Implementation Reference

  • The handler implementation for the 'get_syntax_rules' MCP tool.
    case 'get_syntax_rules': {
      const toolName = String(args?.['tool_name'] ?? '');
      if (!toolName) {
        return { content: [{ type: 'text', text: 'Error: tool_name is required' }] };
      }
      const matches = engine.matchContexts({ tool: toolName });
      const rules: Record<string, unknown> = {};
      for (const m of matches) {
        if (m.context.syntax_rules) {
          rules[m.context.tool_category] = m.context.syntax_rules;
        }
      }
      return {
        content: [
          {
            type: 'text',
            text: Object.keys(rules).length
              ? JSON.stringify(rules, null, 2)
              : `No syntax rules found for tool: ${toolName}`,
          },
        ],
      };
    }
  • The tool registration definition for 'get_syntax_rules'.
    {
      name: 'get_syntax_rules',
      description: 'Get syntax-specific rules for a tool category',
      inputSchema: {
        type: 'object' as const,
        properties: {
          tool_name: {
            type: 'string',
            description: 'Tool name or category',
          },
        },
        required: ['tool_name'],
      },
    },

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