diff --git a/src/main/java/org/apache/solr/mcp/server/schema/SchemaService.java b/src/main/java/org/apache/solr/mcp/server/schema/SchemaService.java index 73bb3405..b1137d4c 100644 --- a/src/main/java/org/apache/solr/mcp/server/schema/SchemaService.java +++ b/src/main/java/org/apache/solr/mcp/server/schema/SchemaService.java @@ -269,9 +269,11 @@ public String getSchemaResource(String collection) { * the name of the Solr collection to retrieve schema information for * @return complete schema representation containing all field and type * definitions - * @throws Exception - * if collection does not exist, access is denied, or communication - * fails + * @throws SolrServerException + * if the Solr server returns an error; a missing collection + * surfaces as an unchecked {@code SolrException} (404) + * @throws IOException + * if communication with the Solr server fails * @see SchemaRepresentation * @see SchemaRequest * @see org.apache.solr.client.solrj.response.schema.SchemaResponse @@ -281,7 +283,7 @@ public String getSchemaResource(String collection) { name = "get-schema", annotations = @McpTool.McpAnnotations(readOnlyHint = true), description = "Get schema for a Solr collection") - public SchemaRepresentation getSchema(String collection) throws Exception { + public SchemaRepresentation getSchema(String collection) throws SolrServerException, IOException { SchemaRequest schemaRequest = new SchemaRequest(); return schemaRequest.process(solrClient, collection).getSchemaRepresentation(); }