mcp-use TypeScript API
    Preparing search index...

    Function completable

    • Make a schema field completable so clients can request autocomplete suggestions via completion/complete.

      Pass an array of allowed values for case-insensitive prefix matching, or a callback for dynamic/contextual suggestions.

      Accepts any Standard Schema field (StandardSchemaV1); zod shown in the example. Apply refinements like .describe() to the schema argument, not to the completable result: refinements that clone the schema (as zod's do) silently drop the SDK's completion marker. .optional() is the one exception — the SDK unwraps optionals when looking for completions.

      Type Parameters

      • T extends StandardSchemaV1<unknown, unknown>

      Parameters

      Returns CompletableSchema<T>

      schema: z.object({
      language: completable(
      z.string().describe("The programming language"),
      ["python", "typescript", "go"]
      ),
      })