> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mcp-use.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Completions

> Autocomplete for prompt and resource template arguments

Request suggestions for prompt arguments or resource template URI variables:

```typescript theme={null}
import { MCPClient } from "@mcp-use/client";

const client = new MCPClient({
  mcpServers: { demo: { url: "http://localhost:3000/mcp" } },
});

try {
  const conn = await client.connect("demo");

  const result = await conn.complete({
    ref: { type: "ref/prompt", name: "code-review" },
    argument: { name: "language", value: "py" },
  });

  console.log(result.completion.values); // e.g. ["python", "pytorch"]
} finally {
  await client.close();
}
```

## React

```tsx theme={null}
const mcp = useMcp({ url: "http://localhost:3000/mcp" });

const result = await mcp.complete({
  ref: { type: "ref/resource", uri: "file:///{path}" },
  argument: { name: "path", value: "/tmp" },
});
```

## Reference

[`MCPConnection`](https://mcp-use-typescript-api-reference.vercel.app/modules/_mcp-use_client.index.html#mcpconnection) — `complete()`.
