Skip to main content
Glama
jumasheff

RAG Documentation MCP Server

by jumasheff

clear_queue

Remove all pending URLs from the documentation processing queue to reset it for fresh starts, cancel pending tasks, or eliminate unwanted items.

Instructions

Remove all pending URLs from the documentation processing queue. Use this to reset the queue when you want to start fresh, remove unwanted URLs, or cancel pending processing. This operation is immediate and permanent - URLs will need to be re-added if you want to process them later. Returns the number of URLs that were cleared from the queue.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler logic that implements the clear_queue tool. It checks if the queue file exists, reads the current content to count URLs, empties the file to clear the queue, and returns a success message with the count or handles errors.
    async execute(_args: any): Promise<McpToolResponse> {
      try {
        // Check if queue file exists
        try {
          await fs.access(QUEUE_FILE);
        } catch {
          return {
            content: [
              {
                type: 'text',
                text: 'Queue is already empty (queue file does not exist)',
              },
            ],
          };
        }
    
        // Read current queue to get count of URLs being cleared
        const content = await fs.readFile(QUEUE_FILE, 'utf-8');
        const urlCount = content.split('\n').filter(url => url.trim() !== '').length;
    
        // Clear the queue by emptying the file
        await fs.writeFile(QUEUE_FILE, '');
    
        return {
          content: [
            {
              type: 'text',
              text: `Queue cleared successfully. Removed ${urlCount} URL${urlCount === 1 ? '' : 's'} from the queue.`,
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Failed to clear queue: ${error}`,
            },
          ],
          isError: true,
        };
      }
    }
  • The tool schema definition including name, description, and empty input schema (no parameters required).
    get definition(): ToolDefinition {
      return {
        name: 'clear_queue',
        description: 'Clear all URLs from the queue',
        inputSchema: {
          type: 'object',
          properties: {},
          required: [],
        },
      };
    }
  • Registers the ClearQueueHandler instance for the 'clear_queue' tool in the handlers map.
    this.handlers.set('clear_queue', new ClearQueueHandler(this.server, this.apiClient));
  • Registers the tool schema in the ListTools response, duplicating the definition for tool discovery.
      name: 'clear_queue',
      description: 'Remove all pending URLs from the documentation processing queue. Use this to reset the queue when you want to start fresh, remove unwanted URLs, or cancel pending processing. This operation is immediate and permanent - URLs will need to be re-added if you want to process them later. Returns the number of URLs that were cleared from the queue.',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    } as ToolDefinition,
  • The ClearQueueHandler class that extends the tool and delegates handle() to execute(), serving as the MCP request handler entry point.
    export class ClearQueueHandler extends ClearQueueTool {
      constructor(server: Server, apiClient: ApiClient) {
        super();
      }
    
    		async handle(args: any) {
    				return this.execute(args);
    		}
    }
Behavior4/5

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

With no annotations provided, the description carries full burden and does so effectively. It discloses critical behavioral traits: the operation is 'immediate and permanent', URLs 'will need to be re-added', and it 'Returns the number of URLs that were cleared'. This covers mutability, permanence, and output format without contradictions.

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?

Perfectly front-loaded with the core action in the first sentence, followed by usage guidance and behavioral details. Every sentence adds value: purpose, when-to-use, permanence warning, and return information. Zero wasted words.

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

Completeness5/5

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

For a 0-parameter tool with no annotations or output schema, the description is complete. It explains what the tool does, when to use it, behavioral consequences (permanent, immediate), and what it returns. No additional context is needed given the tool's simplicity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately focuses on behavior rather than parameters, maintaining a baseline of 4 since it doesn't need to compensate for any parameter gaps.

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 specific action ('Remove all pending URLs') and resource ('documentation processing queue'), distinguishing it from sibling tools like list_queue (which lists) or run_queue (which processes). It uses precise verbs and identifies the exact scope of operation.

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

Usage Guidelines5/5

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

Explicitly states when to use this tool ('to reset the queue when you want to start fresh, remove unwanted URLs, or cancel pending processing') and provides clear alternatives by naming sibling tools like list_queue and run_queue. It gives practical scenarios for application.

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/jumasheff/mcp-ragdoc-fork'

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