Skip to content

Commit 82a6d7f

Browse files
committed
Bump version to 1.4.2
- Enhanced error handling for invalid query types in run_query tool - Added guidance to use get_term_info first when query types are invalid - Updated tool description to emphasize checking available queries before running
1 parent b73ebe1 commit 82a6d7f

2 files changed

Lines changed: 17 additions & 4 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vfb3-mcp",
3-
"version": "1.4.1",
3+
"version": "1.4.2",
44
"description": "MCP server for VirtualFlyBrain API integration",
55
"main": "index.js",
66
"scripts": {

src/index.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import cors from 'cors';
1313
import express from 'express';
1414
import { randomUUID } from 'node:crypto';
1515

16-
const VERSION = '1.4.1';
16+
const VERSION = '1.4.2';
1717

1818
// GA4 Analytics configuration
1919
const GA_MEASUREMENT_ID = process.env.GA_MEASUREMENT_ID || 'G-K7DDZVVXM7';
@@ -84,7 +84,7 @@ function setupToolHandlers(server: Server, sessionIdHolder?: { id?: string }) {
8484
},
8585
{
8686
name: 'run_query',
87-
description: 'Run a query on VirtualFlyBrain using a VFB ID and query type. IMPORTANT: Do NOT pass tool names (like "get_term_info" or "search_terms") as query_type — those are separate tools. Valid query_types are returned by get_term_info in the Queries array for each entity. Common query_types include: PaintedDomains, AllAlignedImages, AlignedDatasets, AllDatasets (for templates); SimilarMorphologyTo, NeuronInputsTo, NeuronNeuronConnectivityQuery (for neurons); ListAllAvailableImages, SubclassesOf, PartsOf, NeuronsPartHere, NeuronsSynaptic, ExpressionOverlapsHere (for classes). Available query_types vary by entity type — always call get_term_info first to see which queries are available for a given ID.',
87+
description: 'Run a query on VirtualFlyBrain using a VFB ID and query type. IMPORTANT: Do NOT pass tool names (like "get_term_info" or "search_terms") as query_type — those are separate tools. Valid query_types are returned by get_term_info in the Queries array for each entity. Common query_types include: PaintedDomains, AllAlignedImages, AlignedDatasets, AllDatasets (for templates); SimilarMorphologyTo, NeuronInputsTo, NeuronNeuronConnectivityQuery (for neurons); ListAllAvailableImages, SubclassesOf, PartsOf, NeuronsPartHere, NeuronsSynaptic, ExpressionOverlapsHere (for classes). Available query_types vary by entity type — ALWAYS call get_term_info FIRST to see which queries are available for a given ID, as attempting invalid query types will result in an error message directing you to use get_term_info.',
8888
inputSchema: {
8989
type: 'object',
9090
properties: {
@@ -94,7 +94,7 @@ function setupToolHandlers(server: Server, sessionIdHolder?: { id?: string }) {
9494
},
9595
query_type: {
9696
type: 'string',
97-
description: 'A valid query type from the Queries array returned by get_term_info (e.g., PaintedDomains, AllAlignedImages, SubclassesOf). Do NOT use tool names here.',
97+
description: 'A valid query type from the Queries array returned by get_term_info (e.g., PaintedDomains, AllAlignedImages, SubclassesOf). Do NOT use tool names here. Always check get_term_info first for available query types.',
9898
},
9999
},
100100
required: ['id', 'query_type'],
@@ -259,6 +259,19 @@ async function handleRunQuery(args: { id: string; query_type: string }) {
259259
],
260260
};
261261
}
262+
263+
// Check if the response contains an error
264+
if (response.data.error) {
265+
return {
266+
content: [
267+
{
268+
type: 'text',
269+
text: `${response.data.error}\n\nTo find valid query types for this term, first use the get_term_info tool with ID "${id}" to see the available queries in the "Queries" array. This will show you the supported query types and expected result counts for this specific entity.`,
270+
},
271+
],
272+
};
273+
}
274+
262275
return {
263276
content: [
264277
{

0 commit comments

Comments
 (0)