Skip to content

MCP Server search-fhir-resources - Query parameter not recognized #878

@stefan-sigle

Description

@stefan-sigle

When trying to search for Patient resources via the MCP Tool search-fhir-resources with MCP Inspector v0.17.2 the query parameter is not recognized.

In the code the query parameter is supposed to be a Map but while debuggin we found that the parameter is returned as string (see

if (config.get("query") instanceof Map<?, ?> q) {
).

This could be fixed by creating a HashMap from the incoming query string, but i suppose it needs a different treatment to handle both a string and a hashmap. Here is a codesnippet that allowed us to use the query parameter as intended:

				Map<String, String> sp = new HashMap<>();

				for (String pair : config.get("query").toString().split(",")) {
					String[] keyValue = pair.split("=", 2);
					if (keyValue.length == 2) {
						sp.put(keyValue[0], keyValue[1]);
					}
				} 

cc @zsebedits

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions