Skip to content

fix(tools): add missing inputSchema on get_current_user and list_users (#79)#95

Open
Abdeltoto wants to merge 1 commit into
smartsheet-platform:mainfrom
Abdeltoto:fix/user-tools-input-schema
Open

fix(tools): add missing inputSchema on get_current_user and list_users (#79)#95
Abdeltoto wants to merge 1 commit into
smartsheet-platform:mainfrom
Abdeltoto:fix/user-tools-input-schema

Conversation

@Abdeltoto

Copy link
Copy Markdown

👋 Hi Smartsheet team,

First-time contributor here. I'm a Smartsheet power user running daily AI workflows on top of smar-mcp (Claude + LangChain), and I noticed a handful of small papercuts while integrating the server into my agentic stack. Rather than just opening issues, I figured I'd send the fixes directly.

This is the first of 3 small, independent PRs I'd like to contribute over the next few days:

  1. This PRfixes [BUG] Error: Invalid schema type or missing properties #79 (invalid input schema on 2 user tools breaking LangChain integration) + adds an anti-regression test that prevents the bug from coming back on any future tool.
  2. Coming next — Jest tests for url-utils.ts to help PR fix: EU region frontend authentication #88 (EU region auth fix) land. A few users have flagged that one as blocking.
  3. Coming after — proposal to make the release pipeline tolerant of NPM_TOKEN issues (root cause of The automated release is failing 🚨 #94).

Each PR is fully self-contained and can be reviewed/merged independently. Happy to iterate on style, scope, or split things further if it helps. Thanks for open-sourcing this — really enjoying building on top of it. 🙏


Summary

Two server.tool() calls in smartsheet-user-tools.ts were registered without an inputSchema argument:

  • get_current_user
  • list_users

This causes the MCP SDK to register tools with an invalid/empty JSON schema, which breaks downstream consumers like @langchain/core/tools (issue #79: Error: Invalid schema type or missing properties).

Fix

Added {} as the inputSchema for both tools (these tools take no parameters). Matches the pattern already used by get_workspaces in smartsheet-workspace-tools.ts.

Anti-regression test

Added src/tools/__tests__/tool-registration-shape.test.ts that loads every tool registrar in the codebase and asserts the 4-arg signature server.tool(name, description, inputSchema, handler) is used. Without the fix, this test fails on exactly the 2 affected tools.

Going forward, any new tool added without a schema will fail CI immediately.

Test plan

  • npm test → 79 passed (was 39, +40 from new file)
  • npm run typecheck clean
  • npx eslint clean on changed files
  • Confirmed test fails on main without the fix (2 failures on the affected tools), passes with the fix

Closes #79. Builds on the diagnosis from #80 by @rickliujh, adds anti-regression coverage to prevent recurrence.

smartsheet-platform#79)

The MCP tool registrations for get_current_user and list_users were missing the inputSchema argument, causing the SDK to register tools with an invalid JSON schema. This breaks downstream consumers like @langchain/core/tools.

Added {} as inputSchema (these tools take no parameters), matching the pattern already used by get_workspaces.

Also adds a generic anti-regression test that loads every tool registrar and asserts the 4-arg server.tool() signature, so this class of bug fails CI immediately on any future tool.

Closes smartsheet-platform#79

Made-with: Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Error: Invalid schema type or missing properties

1 participant