Skip to main content
Glama
Luminaire1337

MTA:SA Documentation MCP Server

clear_cache

Clear the cached documentation for MTA:SA functions by specifying a function name or 'all' to remove all cached data.

Instructions

Clear the MTA:SA documentation cache for a specific function or all functions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
function_nameYesFunction name to clear cache for, or 'all' to clear everything

Implementation Reference

  • Handler function for the 'clear_cache' tool. If function_name is 'all', it clears all docs via queries.clearAllDocs().run(). Otherwise, it normalizes the function name, resolves it via findMetadataByName, and clears cache for that specific function via queries.clearDoc().run(targetName).
    async ({ function_name }): Promise<CallToolResult> => {
      if (function_name.trim().toLowerCase() === "all") {
        queries.clearAllDocs().run();
        return {
          content: [
            {
              type: "text",
              text: `Cleared all cached MTA:SA documents`,
            },
          ],
        };
      }
    
      const normalizedName = normalizeFunctionInput(function_name);
      if (!normalizedName) {
        return {
          content: [
            {
              type: "text",
              text: "Function name is required.",
            },
          ],
        };
      }
    
      const resolved = findMetadataByName(normalizedName);
      const targetName = resolved?.name ?? normalizedName;
      queries.clearDoc().run(targetName);
    
      return {
        content: [
          {
            type: "text",
            text: `Cleared cache for ${targetName}`,
          },
        ],
      };
    },
  • src/index.ts:723-775 (registration)
    Registration of the 'clear_cache' tool on the MCP server, including its description and input schema (function_name string).
    // Register tool: clear_cache
    server.registerTool(
      "clear_cache",
      {
        description:
          "Clear the MTA:SA documentation cache for a specific function or all functions.",
        inputSchema: {
          function_name: z
            .string()
            .describe(
              "Function name to clear cache for, or 'all' to clear everything",
            ),
        },
      },
      async ({ function_name }): Promise<CallToolResult> => {
        if (function_name.trim().toLowerCase() === "all") {
          queries.clearAllDocs().run();
          return {
            content: [
              {
                type: "text",
                text: `Cleared all cached MTA:SA documents`,
              },
            ],
          };
        }
    
        const normalizedName = normalizeFunctionInput(function_name);
        if (!normalizedName) {
          return {
            content: [
              {
                type: "text",
                text: "Function name is required.",
              },
            ],
          };
        }
    
        const resolved = findMetadataByName(normalizedName);
        const targetName = resolved?.name ?? normalizedName;
        queries.clearDoc().run(targetName);
    
        return {
          content: [
            {
              type: "text",
              text: `Cleared cache for ${targetName}`,
            },
          ],
        };
      },
    );
  • The clearDoc query definition – a prepared SQL DELETE statement that removes a single function's cached documentation from function_docs by function_name.
    clearDoc: () =>
      db.prepare(`
      DELETE FROM function_docs WHERE function_name = ?
    `),
  • The clearAllDocs query definition – a prepared SQL DELETE statement that removes all cached documentation from the function_docs table.
    clearAllDocs: () =>
      db.prepare(`
      DELETE FROM function_docs
    `),
  • The normalizeFunctionInput helper used by the handler to normalize user-provided function names before cache clearing.
    const normalizeFunctionInput = (value: string): string => {
      return canonicalizeFunctionName(value.trim());
    };
Behavior2/5

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

No annotations are provided, so the description must bear the burden of behavioral disclosure. It states 'clear the cache' which indicates a destructive action, but does not elaborate on side effects, reversibility, scope (global vs. session), or any warnings about data loss. This is insufficient for a mutating tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, focused sentence that communicates the essential purpose. It is appropriately concise, but could include additional context without becoming verbose.

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?

The description is minimal and does not explain what the tool returns (e.g., success message, count of cleared entries) or any confirmation of the operation. Given the lack of an output schema, this omission leaves the agent uncertain about the tool's response.

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?

The input schema has 100% coverage with a clear description for the single parameter. The description adds no substantive new meaning beyond what the schema already provides, so baseline score of 3 is appropriate.

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 clearly states the tool's action: clearing the MTA:SA documentation cache for a specific function or all functions. It distinguishes itself from sibling tools which focus on searching, listing, or getting documentation, not cache management.

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 alternatives. The description implies its use case (cache clearing), but does not mention prerequisites, when not to use, or alternative approaches like refreshing.

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/Luminaire1337/mtasa-docs-mcp'

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