Skip to main content
Glama
cexll
by cexll

timeout-test

Test timeout prevention by running for a specified duration in milliseconds. Use this tool to verify timeout handling mechanisms in code execution workflows.

Instructions

Test timeout prevention by running for a specified duration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
durationYesDuration in milliseconds (minimum 10ms)

Implementation Reference

  • The main handler function that executes the timeout test by sleeping for the specified duration in steps, reporting progress, and returning a summary of the execution.
    execute: async (args, onProgress) => {
      const duration = args.duration as number;
      const steps = Math.ceil(duration / 5000); // Progress every 5 seconds
      const stepDuration = duration / steps;
      const startTime = Date.now();
    
      const results: string[] = [];
      results.push(`Starting timeout test for ${duration}ms (${duration / 1000}s)`);
    
      for (let i = 1; i <= steps; i++) {
        await new Promise(resolve => setTimeout(resolve, stepDuration));
        const elapsed = Date.now() - startTime;
        results.push(`Step ${i}/${steps} completed - Elapsed: ${Math.round(elapsed / 1000)}s`);
      }
    
      const totalElapsed = Date.now() - startTime;
      results.push(`\nTimeout test completed successfully!`);
      results.push(`Target duration: ${duration}ms`);
      results.push(`Actual duration: ${totalElapsed}ms`);
    
      return results.join('\n');
    },
  • Zod schema defining the input parameter 'duration' as a number with minimum 10ms.
    const timeoutTestArgsSchema = z.object({
      duration: z.number().min(10).describe('Duration in milliseconds (minimum 10ms)'),
    });
  • Registration of the timeoutTestTool into the central toolRegistry along with other tools.
    toolRegistry.push(
      askCodexTool,
      batchCodexTool,
      // reviewCodexTool,
      pingTool,
      helpTool,
      versionTool,
      brainstormTool,
      fetchChunkTool,
      timeoutTestTool
    );

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/cexll/codex-mcp-server'

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