---
title: "DF0043: Invalid RPC Argument"
description: "RPC function \"{name}\" received an invalid argument at position {index}: {issues}"
canonical_url: "https://devfra.me/errors/df0043"
---
# DF0043: Invalid RPC Argument

> RPC function "\{name}" received an invalid argument at position \{index}: \{issues}

## Message

> RPC function "`{name}`" received an invalid argument at position `{index}`: `{issues}`

## Cause

Each declared `args` schema validates its argument before the handler runs, on every path: local, over-the-wire, and the agent/MCP bridge. The argument at `{index}` failed its schema. Validation guards without rewriting, so unmentioned object fields still reach the handler.

## Example

```ts
const greet = defineRpcFunction({
  name: 'greet',
  args: [
    v.string()
  ],
  returns: v.string(),
  handler: name => `hi ${name}`,
})

// ✓ Good
await ctx.rpc.functions.greet('ada')

// ✗ Bad: a number where a string is required → DF0043 at position 0
await ctx.rpc.functions.greet(42 as never)
```

## Fix

Pass a value that satisfies the `args` schema declared for the function, or widen the schema if the value is legitimately allowed.

## Source

- [`packages/devframe/src/rpc/validate-io.ts`](https://github.com/devframes/devframe/blob/main/packages/devframe/src/rpc/validate-io.ts): `validateRpcArgs()` throws `DF0043` on the first argument that fails its declared schema.


## Sitemap

See the full [sitemap](https://devfra.me/sitemap.md) for all pages.
