docs← Back to article

Markdown for LLMs

LDC-Q2009 — A helper is called with the wrong number of arguments

The source Markdown for this article. Copy it into your assistant or download it as a text file.

Download this articlePlain text ↗
# LDC-Q2009 — A helper is called with the wrong number of arguments

## What it means

Each query helper takes a fixed number of arguments: shortening a name
takes one value, testing membership takes two. When the count differs,
the engine cannot run the call, so it stops and reports both numbers —
how many the helper takes and how many the query gave.

Adjust the argument list to the documented count. The helper name and the
rest of the query stay as written.

## Example

Both queries below run against this package:

```law
language "law.core" version "0.2";
package demo.diagnostics version "0.1.0";
namespace "urn:law:demo:diagnostics";

entity Applicant;
relation resident(a: Applicant) kind institutional;
relation permit_eligible(a: Applicant) kind institutional;

rule PermitEligibility strict {
    for a: Applicant;
    when resident(a);
    then permit_eligible(a);
}
```

Shortening takes exactly one value, not two:

```lawql
from r in rules select short(r.id, r.id)
```

## Fix

```lawql
from r in rules select r
```

## Engine message

The engine reports this in its own wording:

```text
LDC-Q2009: short expects 1 args, got 2.
```

## Related

- [Questions to the engine](/constructs/queries/) — the helpers a query can call.
- [LDC-Q2008](/diagnostics/LDC-Q2008/) — when the helper name itself is unknown.