Skip to main content
Glama

get_failure_modes

Retrieve known failure patterns for a service to identify potential issues and improve reliability.

Instructions

Get known failure patterns for a service

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
slugYesService slug to get failure modes for

Implementation Reference

  • The core business logic for fetching and formatting failure modes for a given service.
    export async function handleGetFailureModes(
      input: GetFailureModesInput,
      client: RhumbApiClient
    ): Promise<GetFailureModesOutput> {
      try {
        const score = await client.getServiceScore(input.slug);
        if (!score) return { failures: [] };
    
        return {
          failures: score.failureModes.map((fm) => ({
            pattern: fm.pattern,
            impact: fm.impact,
            frequency: fm.frequency,
            workaround: fm.workaround
          }))
        };
      } catch {
        // Resilient fallback: return empty array on any error
        return { failures: [] };
      }
    }
  • Registration of the get_failure_modes tool in the MCP server instance.
    server.tool(
      "get_failure_modes",
      "Get known failure patterns, impact severity, and workarounds for a service. Use BEFORE integrating to write defensive code, or AFTER hitting an error to diagnose it.",
      {
        slug: z.string().describe(GetFailureModesInputSchema.properties.slug.description)
      },
      async ({ slug }) => {
        const result = await handleGetFailureModes({ slug }, client);
        return {
          content: [{ type: "text" as const, text: JSON.stringify(result) }]
        };
      }
    );
  • Input schema and output type definitions for the get_failure_modes tool.
    export const GetFailureModesInputSchema = {
      type: "object" as const,
      properties: {
        slug: { type: "string" as const, description: "Service slug from find_services results (e.g. 'stripe'). Returns known failure patterns, impact severity, and workarounds." }
      },
      required: ["slug"] as const
    };
    
    export type GetFailureModesInput = {
      slug: string;
    };
    
    export type GetFailureModesOutput = {
      failures: Array<{
        pattern: string;
        impact: string;
        frequency: string;
        workaround: string;
      }>;
    };

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/supertrained/rhumb'

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