Skip to content

Issue with autocompletion when description is nil for MCP tools (Corfu) #68

@sdoyle88

Description

@sdoyle88

Issue

Autocompletion will fail with / if an MCP server does not have a description.

Recreation

Utilize the Flux MCP server, which has a few tools that do not have descriptions such as debug_flux_helmrelease.

Example of the error

Corfu detected an error:
  backtrace-to-string()
  corfu--debug((wrong-type-argument stringp nil))
  string-width(nil)
  truncate-string-to-width(nil 40.0)
  eca-chat--completion-prompts-annotate(#("flux-operator-mcp:debug_flux_helmrelease" 0 40 (eca-chat-completion-item (:name "flux-operator-mcp:debug_flux_helmrelease" :description nil :arguments [(:name "name" :description "The name of the Flux resource." :required t) (:name "namespace" :description "The namespace of the Flux resource." :required t) (:name "cluster" :description "The context name of the cluster, defaults to current." :required nil)] :type "mcpPrompt"))))

I've submitted PR #67 to help fix this. It is a simple fix but this allowed me to enable autocompletion again without a corfu failure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions