Skip to main content
Glama

Record patient intake

record_intake

Record a patient's symptoms, severity (1-10), and onset (ISO 8601) to persist an intake note; the system automatically assigns a triage level: routine, elevated, or urgent.

Instructions

Persist a structured intake note (symptoms, severity, onset) for a patient and assign a triage level (routine / elevated / urgent).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clinic_idYes
patient_idYes
symptomsYes
severityYesPatient-reported severity, 1 (mild) to 10 (worst imaginable)
onset_isoYesWhen symptoms began, ISO 8601
notesNo

Implementation Reference

  • Main handler function for the record_intake tool. Parses input args via Zod, validates the onset_iso timestamp, computes a triage level via triageFor(), calls store.insertIntakeNote(), and returns {intake}.
    export function recordIntake(
      store: ClinicStore,
      raw: unknown,
    ): { intake: IntakeNote } {
      const args = Args.parse(raw);
    
      store.getPatient(args.clinic_id, args.patient_id);
    
      if (Number.isNaN(new Date(args.onset_iso).getTime())) {
        throw new ValidationError("onset_iso must be a valid ISO 8601 timestamp");
      }
    
      const triage = triageFor(args.severity);
    
      const intake = store.insertIntakeNote({
        clinic_id: args.clinic_id,
        patient_id: args.patient_id,
        symptoms: args.symptoms,
        severity: args.severity,
        onset_iso: args.onset_iso,
        ...(args.notes !== undefined ? { notes: args.notes } : {}),
        triage_level: triage,
      });
    
      return { intake };
    }
  • Input schema definition (Zod object shape) for the record_intake tool. Defines clinic_id, patient_id, symptoms (array 1-20), severity (1-10 int), onset_iso (ISO 8601), and optional notes (max 2000 chars).
    export const recordIntakeInput = {
      clinic_id: z.string(),
      patient_id: z.string(),
      symptoms: z.array(z.string().min(1)).min(1).max(20),
      severity: z
        .number()
        .int()
        .min(1)
        .max(10)
        .describe("Patient-reported severity, 1 (mild) to 10 (worst imaginable)"),
      onset_iso: z.string().describe("When symptoms began, ISO 8601"),
      notes: z.string().max(2000).optional(),
    };
  • src/server.ts:72-81 (registration)
    Registration of record_intake tool with the MCP server. Calls server.registerTool with the tool name 'record_intake', its title/description metadata, the inputSchema (recordIntakeInput), and wraps the handler with error handling.
    server.registerTool(
      "record_intake",
      {
        title: "Record patient intake",
        description:
          "Persist a structured intake note (symptoms, severity, onset) for a patient and assign a triage level (routine / elevated / urgent).",
        inputSchema: recordIntakeInput,
      },
      wrap((args) => recordIntake(store, args)),
    );
  • Helper function triageFor() that maps severity (1-10) to a TriageLevel: >=8 is 'urgent', >=5 is 'elevated', else 'routine'. Used inside the recordIntake handler.
    export function triageFor(severity: number): TriageLevel {
      if (severity >= 8) return "urgent";
      if (severity >= 5) return "elevated";
      return "routine";
    }
Behavior2/5

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

No annotations; description only states it persists and assigns triage level, but fails to disclose side effects, authorization needs, or how triage is determined.

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?

Single sentence of 15 words, no redundancy, efficient and direct.

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?

No output schema, no description of return value (e.g., triage level or record ID), insufficient to fully specify tool behavior.

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?

Description mentions 'symptoms, severity, onset' but omits 'clinic_id', 'patient_id', and 'notes'. Schema coverage is 33%, leaving param gaps unaddressed.

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 ('persist') and the resource ('structured intake note') with key fields, distinguishing it from sibling tools like 'book_appointment'.

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?

No guidance on when to use this tool versus alternatives. No mention of prerequisites or exclusions.

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