> ## Documentation Index
> Fetch the complete documentation index at: https://helix-digitalocean.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# E401

# MCP Single Value Requirement

## Erroneous Code Example

This error occurs when an MCP (Model Context Protocol) query returns multiple values when only a single value is expected.

In this example, the MCP query returns multiple users, but MCP expects a single value.
This is so the agent using the MCP tool can traverse from the return value of the query.

<CodeGroup>
  ```rust queries.hx theme={null}
  #[mcp]
  Query getUsers(userId: ID, postId: ID) =>
      user <- N<User>(userId)
      post <- N<Post>(postId)
      RETURN user, post
  ```
</CodeGroup>

## Solution

Ensure MCP queries return exactly one value.

<CodeGroup>
  ```rust queries.hx theme={null}
  #[mcp]
  Query getUsers(userId: ID, postId: ID) =>
      user <- N<User>(userId)
      post <- N<Post>(postId)
      RETURN user
  ```
</CodeGroup>
