Skip to main content
Glama
maheshbalan

FHIR MCP Server

by maheshbalan

add_document_to_pinecone

Ingest a clinical document into Pinecone by URL and FHIR DocumentReference ID, making it searchable for semantic retrieval and RAG.

Instructions

IMPORTANT: Always inform the user at the beginning of your response that this search operation may take some time because the embedding model will be loaded into cache. Adds a document to the Pinecone vector index for the specified FHIR DocumentReference ID.

This tool should be used to ingest new documents into the Pinecone index.

Rules: - If you cannot determine the format of the document fitting the format from the list, provide the format as None. - After adding the document, the Pinecone index may take up to 1 minute to update before the document is searchable.

Args: url (str): The URL of the document to be added. fhir_document_id (str): The ID of the FHIR DocumentReference resource corresponding to the document. format (literal | None): The format of the document.

Returns: str: Confirmation message that the document was added or already exists. PineconeError: Error object with a message if the operation fails.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
documentYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It mentions that the embedding model is loaded into cache (causing delay), that the index may take up to 1 minute to update, and describes the return values. This provides substantial insight beyond the schema, though the 'search operation' wording slightly tarnishes clarity.

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?

The description is organized into sections (IMPORTANT note, description, rules, args, returns) but is verbose. The opening note is long and confusing, and the phrase 'This tool should be used to ingest new documents' is somewhat redundant. The overall structure is usable but not concise or tightly front-loaded.

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

Completeness4/5

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

The description covers the main purpose, usage, latency expectations, index update behavior, and return values. It lacks mention of prerequisites (e.g., FHIR DocumentReference existence) but is otherwise fairly complete for a document ingestion tool. The combination of annotations being absent and the output schema not being shown increases the usefulness of the provided Returns section.

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?

The schema has a single required 'document' object with nested fields (url, fhir_document_id, format), but the description's Args section lists 'url', 'fhir_document_id', and 'format' as if they were top-level parameters. This misrepresents the input structure and could lead the agent to pass arguments incorrectly. The description does add value by explaining each field, but the structural mismatch is a significant issue.

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

Purpose3/5

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

The main sentence 'Adds a document to the Pinecone vector index for the specified FHIR DocumentReference ID' clearly states the verb and resource. However, the opening IMPORTANT note refers to 'this search operation', which is misleading since the tool is for adding documents, not searching. This contradicts the tool's name and confuses the agent's understanding of what the tool does.

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?

The description explicitly states 'This tool should be used to ingest new documents into the Pinecone index', giving clear usage context. It also provides a rule about setting format to None when unknown. However, it does not explicitly mention when not to use this tool or alternatives like search_pinecone, though the distinction is implied.

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/maheshbalan/fhir-mcp-server'

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