Skip to content

Commit 71cc01f

Browse files
authored
fix: DH-21947: MCP data tool fixes (#314)
DH-21947: MCP data tool fixes - `getTableData` now supports hierarchical tables. The crux of the fix is in `getTableOrError` which now finds the variable to use the proper object type for the `getObject` call - fixed an output schema error with `connectToServer` tool Rest of the PR is mostly just updating tool dependencies + cleaning up tests. ## Testing Create a rollup table. I used: ```py from deephaven import new_table from deephaven.column import string_col, int_col, double_col # Create hierarchical test data sales_data = new_table([ string_col("Region", ["North", "North", "North", "North", "South", "South", "South", "East", "East", "West"]), string_col("State", ["NY", "NY", "MA", "MA", "TX", "TX", "FL", "PA", "NJ", "CA"]), string_col("City", ["NYC", "Albany", "Boston", "Cambridge", "Houston", "Dallas", "Miami", "Philly", "Newark", "LA"]), int_col("Sales", [1000, 500, 800, 600, 1200, 900, 700, 850, 650, 1100]), double_col("Revenue", [10000.0, 5000.0, 8000.0, 6000.0, 12000.0, 9000.0, 7000.0, 8500.0, 6500.0, 11000.0]) ]) ``` Ask the agent to get data from the `sales_data` table. It should return the data matching the table.
1 parent 9131f21 commit 71cc01f

15 files changed

Lines changed: 859 additions & 563 deletions

AGENTS.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ For detailed instructions on writing tests (mocking patterns, test structure, MC
3030
- **Main skill**: `.github/skills/test-writing/SKILL.md`
3131
- **MCP-specific patterns**: `.github/skills/test-writing/mcp-tools-testing.md`
3232

33+
## Linting
34+
35+
### Running ESLint
36+
37+
- Use `npm run test:lint` to check all TypeScript files for linting errors
38+
- **IMPORTANT**: The `get_errors` tool may not catch all linting issues, especially in files that aren't currently open in the editor
39+
- Always run `npm run test:lint` before committing to ensure all files pass linting
40+
3341
## MCP Tools
3442

3543
### Writing MCP Tools

package-lock.json

Lines changed: 184 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,6 +1066,7 @@
10661066
"@deephaven-enterprise/auth-nodejs": "^1.20250219.134-beta",
10671067
"@deephaven-enterprise/query-utils": "^1.20250219.134-beta",
10681068
"@deephaven/jsapi-nodejs": "^1.15.0",
1069+
"@deephaven/jsapi-utils": "^1.16.0",
10691070
"@modelcontextprotocol/sdk": "^1.27.1",
10701071
"archiver": "^7.0.1",
10711072
"chai": "^4.5.0",
@@ -1076,10 +1077,12 @@
10761077
"@cfworker/json-schema": "^4.1.1",
10771078
"@deephaven-enterprise/jsapi-types": "^1.20250219.134-beta",
10781079
"@deephaven/jsapi-types": "^41.2.0",
1080+
"@react-types/shared": "^3.33.1",
10791081
"@types/archiver": "^6.0.3",
10801082
"@types/chai": "^4.3.20",
10811083
"@types/mocha": "^10.0.10",
10821084
"@types/node": "22.19.1",
1085+
"@types/react": "^19.2.14",
10831086
"@types/vscode": "^1.105.0",
10841087
"@types/vscode-webview": "^1.57.5",
10851088
"@types/ws": "^8.5.10",

src/mcp/tools/connectToServer.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ const spec = {
1616
inputSchema: {
1717
url: z.string().describe('Server URL (e.g., "http://localhost:10000")'),
1818
},
19-
outputSchema: createMcpToolOutputSchema(),
19+
outputSchema: createMcpToolOutputSchema({
20+
type: z.enum(['DHC', 'DHE']).optional().describe('Server type'),
21+
url: z.string().optional().describe('Server URL'),
22+
}),
2023
} as const;
2124

2225
type Spec = typeof spec;

0 commit comments

Comments
 (0)