CherryHQ/cherry-studio · warning · Error

No arguments provided

Error message

No arguments provided

What it means

Inside the CallToolRequestSchema handler, if request.params.arguments is falsy (null/undefined) the code throws 'No arguments provided'. MCP clients normally send an arguments object even when empty, so this indicates a malformed or non-conformant client call.

Source

Thrown at src/main/ai/mcp/servers/braveSearch.ts:325

          tools: {}
        }
      }
    )
    this.initialize()
  }

  initialize() {
    // Tool handlers
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [WEB_SEARCH_TOOL, LOCAL_SEARCH_TOOL]
    }))

    this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
      try {
        const { name, arguments: args } = request.params

        if (!args) {
          throw new Error('No arguments provided')
        }

        switch (name) {
          case 'brave_web_search': {
            if (!isBraveWebSearchArgs(args)) {
              throw new Error('Invalid arguments for brave_web_search')
            }
            const { query, count = 10 } = args
            const results = await performWebSearch(this.apiKey, query, count)
            return {
              content: [{ type: 'text', text: results }],
              isError: false
            }
          }

          case 'brave_local_search': {
            if (!isBraveLocalSearchArgs(args)) {
              throw new Error('Invalid arguments for brave_local_search')

View on GitHub (pinned to 726446b54c)

Solutions

  1. Ensure the caller always sends arguments as an object — use {} when no fields are needed.
  2. If you control the client, default arguments to {} before sending the CallTool request.
  3. On the server side, coerce missing args to {} before validation if an empty object is meaningful.

Example fix

// before
const { name, arguments: args } = request.params
if (!args) {
  throw new Error('No arguments provided')
}

// after — default to empty object, let schema validation surface required-field errors
const { name, arguments: args = {} } = request.params
Defensive patterns

Strategy: validation

Validate before calling

// Coerce missing args to {} so schema validation handles required fields
function normalizeCallArgs(request) {
  const args = request.params.arguments
  if (args == null) request.params.arguments = {}
  else if (typeof args !== 'object' || Array.isArray(args)) {
    throw new Error('arguments must be an object')
  }
  return request
}

Type guard

function isArgsObject(v): v is Record<string, unknown> {
  return typeof v === 'object' && v !== null && !Array.isArray(v)
}

Try / catch

// Always send an object from the client
const args = request.params.arguments ?? {}
if (!isArgsObject(args)) return { content: [{ type: 'text', text: 'arguments must be an object' }], isError: true }

Prevention

When it happens

Trigger: An MCP client invokes brave_web_search or brave_local_search with arguments omitted or explicitly null rather than an empty object. Common with hand-crafted JSON-RPC or buggy LLM tool-call serialization.

Common situations: An LLM emits a tool call with no parameters; a test harness sends {arguments: null}; an older MCP client that treats arguments as optional.

Related errors


AI-assisted analysis of CherryHQ/cherry-studio@726446b54c (2026-08-12). Data as JSON: /api/errors/3a4ec5b938e0ab92. Report an issue: GitHub.