Skip to main content
Glama
maheshbalan

FHIR MCP Server

by maheshbalan

search_pinecone

Retrieve relevant information from indexed FHIR documents by searching the Pinecone vector index with a query and document ID.

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. Searches the Pinecone vector index for information related to the given document by FHIR DocumentReference ID.

Use this tool when the user requests information from the documents, notes, etc.

Rules: - Firstly, prepare fhir_document_id by running the appropriate tool. - If the error message "Document does not exist in Pinecone index" is returned, automatically trigger the 'add_document_to_pinecone' tool to add the missing document to the index. - Translate the user's query into the language of the document before performing the search. - Base all answers strictly on the content found in the Pinecone index documents. - If the user's question is unrelated to the indexed documents, respond that the information is not available in the documents. - If the query is unclear or ambiguous, ask the user to clarify or provide more details. - You can modify the query to make it more specific and relevant to the document.

Args: query (str): The user's search query. fhir_document_id (str): The ID of the FHIR DocumentReference resource to search within - it is the same as the FHIR ID of the document. top_k (int, optional): The maximum number of search results to return. Defaults to 10.

Returns: list[PineconeSearchResponse]: List of search results matching the query. PineconeError: Error object with a message if the search fails.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
top_kNo
fhir_document_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations provided, the description carries the full burden. It discloses the embedding model loading delay and instructs to warn the user, auto-triggering of add_document_to_pinecone on missing document, query translation, strict answer grounding, and clarification handling. This is rich behavioral context beyond a simple search operation.

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?

The description is well-structured with an IMPORTANT note and bulleted rules. Every sentence serves a purpose—covering user warnings, usage context, prerequisites, error handling, and query processing rules. It is appropriately sized for the tool's complexity.

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

Completeness5/5

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

The description covers all three parameters, return type (list of PineconeSearchResponse), error handling, and the full workflow from preparation to answer generation. It is self-sufficient even without annotations or explicit output schema detail.

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

Parameters5/5

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

The Args section explains each parameter with meaning and default: query is the user's search query, fhir_document_id matches the FHIR DocumentReference ID, and top_k defaults to 10. Since schema description coverage is 0%, this parameter detail is essential and fully compensates.

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: 'Searches the Pinecone vector index for information related to the given document by FHIR DocumentReference ID.' This specifies the verb, resource, and scope, and differentiates from sibling tools like add_document_to_pinecone and resource requesters.

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

Usage Guidelines5/5

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

It explicitly says when to use the tool ('when the user requests information from the documents, notes'), provides prerequisites (prepare fhir_document_id by running the appropriate tool), and describes when not to use it (unrelated questions). It also names the alternative add_document_to_pinecone for error handling, making the usage guidance comprehensive.

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