Skip to main content
Glama

Escalate an appointment to the on-call provider

escalate_to_oncall

Mark an existing appointment as urgent and reassign it to the clinic's on-call provider, ensuring immediate attention for critical cases.

Instructions

Mark an existing appointment as urgent and reassign it to the clinic's on-call provider.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clinic_idYes
appointment_idYes
reasonYes

Implementation Reference

  • Core handler function that escalates an appointment to the on-call provider: validates args, fetches appointment, finds on-call provider, updates appointment status to 'urgent' and reassigns provider, returns result with appointment, on-call provider info, and reassignment flag.
    export function escalateToOncall(
      store: ClinicStore,
      raw: unknown,
    ): EscalateResult {
      const args = Args.parse(raw);
    
      const appointment = store.getAppointment(args.clinic_id, args.appointment_id);
      const oncall = store.findOnCallProvider(args.clinic_id);
      if (!oncall) {
        throw new ConflictError(
          `clinic ${args.clinic_id} has no on-call provider configured`,
        );
      }
    
      const reassigned = appointment.provider_id !== oncall.id;
      const updated = store.updateAppointment(args.clinic_id, appointment.id, {
        status: "urgent",
        provider_id: oncall.id,
        reason: `${appointment.reason} | escalated: ${args.reason}`,
      });
    
      return {
        appointment: updated,
        on_call_provider: {
          id: oncall.id,
          name: oncall.name,
          specialty: oncall.specialty,
        },
        reassigned,
      };
    }
  • Input schema for escalate_to_oncall tool: clinic_id (string), appointment_id (string), reason (string 1-500 chars).
    export const escalateToOncallInput = {
      clinic_id: z.string(),
      appointment_id: z.string(),
      reason: z.string().min(1).max(500),
    };
  • Output type definition for the escalate result: appointment, on_call_provider info, and reassigned boolean.
    export interface EscalateResult {
      appointment: Appointment;
      on_call_provider: Pick<Provider, "id" | "name" | "specialty">;
      reassigned: boolean;
  • src/server.ts:94-103 (registration)
    Registration of the 'escalate_to_oncall' tool on the MCP server with title, description, input schema, and handler callback.
    server.registerTool(
      "escalate_to_oncall",
      {
        title: "Escalate an appointment to the on-call provider",
        description:
          "Mark an existing appointment as urgent and reassign it to the clinic's on-call provider.",
        inputSchema: escalateToOncallInput,
      },
      wrap((args) => escalateToOncall(store, args)),
    );
Behavior2/5

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

No annotations provided, so description carries full burden. It only states 'mark as urgent and reassign' without detailing side effects (e.g., notifications, status changes) or reversibility.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence is efficient but omits critical details; adequate but could include a brief second sentence without losing conciseness.

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

Completeness2/5

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

Lacks output description and any mention of consequences or constraints (e.g., irreversibility), leaving the agent uninformed for correct invocation.

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

Parameters2/5

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

Schema coverage is 0%, and description adds no parameter details beyond names. 'reason' is not explained as the reason for urgency; clinic_id/appointment_id are self-evident but lack any validation context.

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 action ('mark as urgent and reassign') and resource ('existing appointment'), and clearly distinguishes from sibling tools like book_appointment or find_available_slot.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool vs alternatives, no prerequisites (e.g., appointment must exist), and no conditions to avoid (e.g., already escalated).

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/dominikstefanski/clinic-mcp'

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