-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
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
hapi-fhir-jpaserver-starter/src/main/java/ca/uhn/fhir/jpa/starter/mcp/RequestBuilder.java
Line 44 in ccf97bd
| 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
zsebedits
Metadata
Metadata
Assignees
Labels
No labels