Skip to main content
Glama

diagnostics

Retrieve browser cache, errors, and performance metrics to troubleshoot issues with Strudel music pattern generation and playback.

Instructions

Get detailed browser diagnostics including cache, errors, and performance

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler for the 'diagnostics' tool. Checks initialization, then delegates to ctx.controller.getDiagnostics().
    case 'diagnostics': {
      if (!ctx.isInitialized()) {
        return {
          initialized: false,
          message: 'Browser not initialized. Run init first for full diagnostics.',
        };
      }
      return await ctx.controller.getDiagnostics();
    }
  • Schema definition for the 'diagnostics' tool: name, description, and empty inputSchema (no parameters).
    {
      name: 'diagnostics',
      description: 'Get detailed browser diagnostics including cache, errors, and performance',
      inputSchema: { type: 'object', properties: {} },
  • BrowserDiagnostics interface: browserConnected, pageLoaded, editorReady, audioConnected, cacheStatus, errorStats.
    export interface BrowserDiagnostics {
      browserConnected: boolean;
      pageLoaded: boolean;
      editorReady: boolean;
      audioConnected: boolean;
      cacheStatus: {
        hasCache: boolean;
        cacheAge: number;
      };
      errorStats: Record<string, ErrorStats>;
    }
  • getDiagnostics() on StrudelController: gathers browser/page state, editor readiness, audio connection, cache info, and error stats.
    async getDiagnostics(): Promise<BrowserDiagnostics> {
      const diagnostics: BrowserDiagnostics = {
        browserConnected: this.browser !== null,
        pageLoaded: this._page !== null,
        editorReady: false,
        audioConnected: false,
        cacheStatus: {
          hasCache: this.editorCache.length > 0,
          cacheAge: this.cacheTimestamp > 0 ? Date.now() - this.cacheTimestamp : 0
        },
        errorStats: this.errorRecovery.getErrorStats()
      };
    
      if (this._page) {
        try {
          // Check that strudelMirror API is available
          diagnostics.editorReady = await this._page.evaluate(() => {
            const sm = (window as any).strudelMirror;
            return sm?.editor?.dispatch !== undefined;
          });
    
          diagnostics.audioConnected = await this._page.evaluate(() => {
            return (window as any).strudelAudioAnalyzer?.isConnected || false;
          });
        } catch (error) {
          this.logger.warn('Failed to get diagnostics', error);
        }
      }
    
      return diagnostics;
    }
  • Registration: diagnosticsModule.tools are spread into the server's tool list.
    // Performance, diagnostics, screenshots — extracted to src/server/tools/diagnostics.ts (#104)
    ...diagnosticsModule.tools,
Behavior2/5

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

With no annotations, the description carries full behavioral disclosure burden. It indicates a read operation (get diagnostics) but does not describe side effects, authentication needs, rate limits, or the structure of the returned data. Minimal transparency for a read tool.

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?

A single sentence that is front-loaded with the verb 'Get' and the resource 'browser diagnostics'. No extraneous information, highly efficient.

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

Completeness3/5

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

Given no annotations or output schema, the description lists included diagnostics (cache, errors, performance) but lacks detail on return format or structure. For a zero-parameter tool, it is adequate but could be more complete (e.g., specifying the response is a JSON object).

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 tool has no parameters, so the schema coverage is 100%. Per guidelines, baseline for 0 parameters is 4. The description adds no additional parameter meaning beyond what the schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool gets browser diagnostics including cache, errors, and performance. It distinguishes from siblings like show_errors (which is error-specific) and performance_report (performance-specific) by being a broader aggregation, but does not explicitly differentiate.

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?

The description implies usage when a broad diagnostic overview is needed, but provides no explicit guidance on when to use this tool versus alternatives like show_errors or memory_usage. No exclusions or prerequisites are mentioned.

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/williamzujkowski/live-coding-music-mcp'

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