Skip to main content
Glama
the-momentum

FHIR MCP Server

by the-momentum

search_pinecone

Search FHIR documents for relevant information using vector embeddings. Retrieve answers from indexed notes and documents 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?

No annotations are provided, so the description carries the full burden. It discloses important behaviors: the delay due to embedding model loading, query language translation, strict grounding in indexed documents, and the automatic fallback to add_document_to_pinecone. This far exceeds minimal expectations.

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

Conciseness4/5

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

The description is well-structured with an IMPORTANT callout, a concise purpose statement, a rules list, and clearly labeled Args/Returns sections. It is longer than necessary but every sentence contributes operational guidance without waste.

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?

Given the tool's complexity and lack of annotations, the description is remarkably complete. It covers prerequisites, error handling, language translation, answer scope, ambiguity handling, and query modification. Output schema exists, so return details need no elaboration.

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

Parameters4/5

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

Schema has 0% description coverage, but the Args section explains all three parameters. It clarifies fhir_document_id as 'the same as the FHIR ID of the document,' which adds valuable meaning. query and top_k are adequately described, though query is somewhat generic.

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 states a specific action: 'Searches the Pinecone vector index for information related to the given document by FHIR DocumentReference ID.' This clearly distinguishes it from sibling tools like add_document_to_pinecone and request_document_reference_resource.

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?

Explicitly says 'Use this tool when the user requests information from the documents, notes, etc.' and provides detailed rules including prerequisites (prepare fhir_document_id), fallback (trigger add_document_to_pinecone on error), and handling of unrelated queries.

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

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