Skip to main content
Glama
Luminaire1337

MTA:SA Documentation MCP Server

recommend_doc_workflow

Plans the next documentation lookups for a given MTA:SA task, guiding AI to call the right tools and avoid manual scraping.

Instructions

Planner tool that tells LLMs exactly which mtasa-docs tools to call next for a given task. Use this to enforce MCP-first workflows and avoid manual wiki scraping.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_descriptionYesWhat the user wants to build or debug
known_function_namesNoFunction names already known in the conversation

Implementation Reference

  • The handler function for the recommend_doc_workflow tool. It takes task_description and known_function_names, uses findRelatedFunctions and other helpers to build a recommended workflow output string with steps for discovery, documentation retrieval, example extraction, and implementation rules.
    async ({
      task_description,
      known_function_names,
    }): Promise<CallToolResult> => {
      const normalizedKnown = dedupeFunctionsByName(
        known_function_names
          .map(normalizeFunctionInput)
          .map((name) => findMetadataByName(name))
          .filter((item): item is MtasaFunction => Boolean(item)),
      );
    
      const taskMatches = dedupeFunctionsByName(
        findRelatedFunctions(task_description, 8),
      );
      const eventTaskMatches = filterEventEntries(taskMatches).slice(0, 6);
    
      const searchHints = task_description
        .split(/[^A-Za-z0-9_]+/)
        .map((word) => word.trim())
        .filter((word) => word.length > 2)
        .slice(0, 6);
    
      let output = "# Recommended MCP Workflow\n\n";
      output += `Task: ${task_description}\n\n`;
      output += "1) Discovery\n";
      output +=
        "- Call `find_functions_for_task` with the full task description.\n";
      output +=
        "- If the task is event-driven, call `find_events_for_task` (or `search_events`) to get event names only.\n";
      if (searchHints.length > 0) {
        output +=
          "- Optional: call `search_functions` with these focused terms: " +
          searchHints.join(", ") +
          "\n";
      }
    
      output += "\n2) Documentation Retrieval\n";
      output +=
        "- Call `get_multiple_function_docs` with top candidates before writing code.\n";
      output +=
        "- If one function/event is uncertain, call `get_function_docs` individually first.\n";
      output +=
        "- By default optional arguments are hidden; set include_optional_arguments=true only when needed.\n";
    
      output += "\n3) Example Extraction\n";
      output +=
        "- Call `get_function_examples` for functions where implementation style matters.\n";
    
      output += "\n4) Implementation Rule\n";
      output +=
        "- Treat docs returned by this MCP as source of truth for signatures, side (client/server/shared), and deprecations.\n";
    
      if (normalizedKnown.length > 0) {
        output += "\nKnown valid functions in context:\n";
        output += `${formatFunctionList(normalizedKnown)}\n`;
      }
    
      if (taskMatches.length > 0) {
        output += "\nTop suggested functions for this task:\n";
        output += `${formatFunctionList(taskMatches)}\n`;
      }
    
      if (eventTaskMatches.length > 0) {
        output += "\nTop suggested events for this task:\n";
        output += `${formatFunctionList(eventTaskMatches)}\n`;
      }
    
      return {
        content: [
          {
            type: "text",
            text: output,
          },
        ],
      };
    },
  • Input schema definition for recommend_doc_workflow using Zod. Defines task_description (string, required) and known_function_names (optional array of strings, defaults to empty array).
    {
      description:
        "Planner tool that tells LLMs exactly which mtasa-docs tools to call next for a given task. Use this to enforce MCP-first workflows and avoid manual wiki scraping.",
      inputSchema: {
        task_description: z
          .string()
          .describe("What the user wants to build or debug"),
        known_function_names: z
          .array(z.string())
          .optional()
          .default([])
          .describe("Function names already known in the conversation"),
      },
    },
  • src/index.ts:629-721 (registration)
    Registration of the recommend_doc_workflow tool via server.registerTool(...) with name, schema, and handler callback.
    server.registerTool(
      "recommend_doc_workflow",
      {
        description:
          "Planner tool that tells LLMs exactly which mtasa-docs tools to call next for a given task. Use this to enforce MCP-first workflows and avoid manual wiki scraping.",
        inputSchema: {
          task_description: z
            .string()
            .describe("What the user wants to build or debug"),
          known_function_names: z
            .array(z.string())
            .optional()
            .default([])
            .describe("Function names already known in the conversation"),
        },
      },
      async ({
        task_description,
        known_function_names,
      }): Promise<CallToolResult> => {
        const normalizedKnown = dedupeFunctionsByName(
          known_function_names
            .map(normalizeFunctionInput)
            .map((name) => findMetadataByName(name))
            .filter((item): item is MtasaFunction => Boolean(item)),
        );
    
        const taskMatches = dedupeFunctionsByName(
          findRelatedFunctions(task_description, 8),
        );
        const eventTaskMatches = filterEventEntries(taskMatches).slice(0, 6);
    
        const searchHints = task_description
          .split(/[^A-Za-z0-9_]+/)
          .map((word) => word.trim())
          .filter((word) => word.length > 2)
          .slice(0, 6);
    
        let output = "# Recommended MCP Workflow\n\n";
        output += `Task: ${task_description}\n\n`;
        output += "1) Discovery\n";
        output +=
          "- Call `find_functions_for_task` with the full task description.\n";
        output +=
          "- If the task is event-driven, call `find_events_for_task` (or `search_events`) to get event names only.\n";
        if (searchHints.length > 0) {
          output +=
            "- Optional: call `search_functions` with these focused terms: " +
            searchHints.join(", ") +
            "\n";
        }
    
        output += "\n2) Documentation Retrieval\n";
        output +=
          "- Call `get_multiple_function_docs` with top candidates before writing code.\n";
        output +=
          "- If one function/event is uncertain, call `get_function_docs` individually first.\n";
        output +=
          "- By default optional arguments are hidden; set include_optional_arguments=true only when needed.\n";
    
        output += "\n3) Example Extraction\n";
        output +=
          "- Call `get_function_examples` for functions where implementation style matters.\n";
    
        output += "\n4) Implementation Rule\n";
        output +=
          "- Treat docs returned by this MCP as source of truth for signatures, side (client/server/shared), and deprecations.\n";
    
        if (normalizedKnown.length > 0) {
          output += "\nKnown valid functions in context:\n";
          output += `${formatFunctionList(normalizedKnown)}\n`;
        }
    
        if (taskMatches.length > 0) {
          output += "\nTop suggested functions for this task:\n";
          output += `${formatFunctionList(taskMatches)}\n`;
        }
    
        if (eventTaskMatches.length > 0) {
          output += "\nTop suggested events for this task:\n";
          output += `${formatFunctionList(eventTaskMatches)}\n`;
        }
    
        return {
          content: [
            {
              type: "text",
              text: output,
            },
          ],
        };
      },
    );
Behavior3/5

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

No annotations are provided, so the description must fully convey behavioral traits. It states the tool 'tells' which tools to call, implying a read-only recommendation, but does not disclose any potential side effects, authentication needs, or output format. For a tool with no annotations, this is adequate but not thorough.

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?

The description is two sentences with no extraneous words. The first sentence conveys core functionality, the second gives usage guidance. Every sentence earns its place.

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

Completeness4/5

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

Given 2 parameters (1 required), no output schema, and no annotations, the description is largely complete. It explains the tool's role and when to use it. However, it lacks details on the output format or how recommendations are presented, which could help an agent understand the tool's behavior fully.

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% with descriptions for both parameters. The tool description does not add meaning beyond what the schema provides: 'task_description' is for user's task, 'known_function_names' for already known names. Baseline 3 is appropriate given high coverage.

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 purpose as a planner that tells LLMs which mtasa-docs tools to call next for a given task. It uses specific verb 'tells' and resource 'which tools to call', distinguishing it from sibling tools which are individual doc retrieval tools.

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

Usage Guidelines4/5

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

The description explicitly says 'Use this to enforce MCP-first workflows and avoid manual wiki scraping', giving clear usage context. It implies when to use but does not explicitly state when not to use or mention sibling alternatives, though its unique role as a planner makes alternatives obvious.

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