Skip to main content
Glama

build_resource

Build a validated FHIR resource from flat fields, handling complex nesting like CodeableConcepts and Dosage. Returns success or issues for correction.

Instructions

Build a FHIR resource from flat fields and validate it. Call this instead of writing FHIR JSON by hand — it does the nesting (CodeableConcepts, Dosage) and returns {ok, resource} or {ok: false, issues} to correct. Supported resource_type values: Condition, MedicationStatement, Observation, AllergyIntolerance, Patient. Use a code returned by lookup_code, never an invented one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNo
unitNo
onsetNo
valueNo
genderNo
statusNo
systemNo
displayNo
subjectNo
dose_unitNo
birth_dateNo
dose_valueNo
dosage_textNo
resource_typeYes
frequency_per_dayNo
effective_datetimeNo
Behavior3/5

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

Discloses nesting behavior (CodeableConcepts, Dosage), return format {ok, resource} or {ok: false, issues}, and validation. No annotations provided, so description carries full burden. However, it's ambiguous whether the resource is persisted; could be clearer about side effects.

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?

Three sentences, front-loaded with purpose and key guidance, no wasted words. Efficient and well-structured.

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?

Covers purpose, return format, supported types, and a critical rule about codes. However, with 16 parameters and no output schema, the description lacks detailed parameter mapping and resource-type-specific instructions, leaving gaps for correct usage.

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 has 16 parameters with 0% coverage, but description only mentions resource_type and code usage rule. Does not explain parameters like onset, value, unit, etc., or how they map to resource types. The description adds minimal value over the schema for parameter meaning.

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 tool builds and validates a FHIR resource from flat fields, lists supported resource types, and contrasts with writing FHIR JSON manually, distinguishing it from siblings like validate_resource and lookup_code.

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

Usage Guidelines4/5

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

Provides clear guidance: 'Call this instead of writing FHIR JSON by hand' and 'Use a code returned by lookup_code, never an invented one.' Also lists supported resource types. Missing explicit when-not-to-use or comparison to siblings.

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/healthchainai/HealthChain'

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