Skip to main content
Glama

get_tool_context

Retrieve complete context including rules, syntax, and preferences for any tool to maintain consistent settings across chat sessions without manual reconfiguration.

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

  • The request handler logic for 'get_tool_context' tool in the MCP server. It uses the engine to match contexts for the given tool_name and returns them.
    case 'get_tool_context': {
      const toolName = String(args?.['tool_name'] ?? '');
      if (!toolName) {
        return { content: [{ type: 'text', text: 'Error: tool_name is required' }] };
      }
      const matches = engine.matchContexts({ tool: toolName });
      if (matches.length === 0) {
        return {
          content: [{ type: 'text', text: `No context found for tool: ${toolName}` }],
        };
      }
      const merged = matches.map((m) => m.context);
      return { content: [{ type: 'text', text: JSON.stringify(merged, null, 2) }] };
    }
  • The definition and registration of the 'get_tool_context' tool in the MCP server list tools handler.
    {
      name: 'get_tool_context',
      description:
        'Get complete context (rules, syntax, preferences) for a specific tool',
      inputSchema: {
        type: 'object' as const,
        properties: {
          tool_name: {
            type: 'string',
            description: 'Tool name or category (e.g. "git", "dokuwiki", "terraform")',
          },
        },
        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