这是indexloc提供的服务,不要输入任何密码
Skip to content

[BUG]: Custom Agent Works, but MCP Tool Call Fails via AnythingLLM API #3718

@rioultf

Description

@rioultf

How are you running AnythingLLM?

AnythingLLM desktop app

What happened?

TL; DR. I wasn't able to make a request to the AnythingLLM API that triggers the use of an MCP server. Has anyone succeeded?

I understand that to call an agent in the sense of custom skill, you need to use the API workspace/{slug}/chat (or stream-chat). I managed to do it:

curl -X 'POST' \
  'http://127.0.0.1:3001/api/v1/workspace/unicaen/chat' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer xxx' \
  -H 'Content-Type: application/json' \
  -d '{
  "message": "@agent what is the temperature in 48.929557/-0.469883 ? /exit",
  "mode": "chat",
  "sessionId": "identifier-to-partition-chats-by-external-id",
  "reset": false
}'

The response is correct (my agent always returns 10):

{
  "id": "79a1e5df-7568-4e09-97fb-14300959d693",
  "type": "textResponse",
  "sources": [],
  "close": true,
  "error": null,
  "textResponse": "The current temperature at 48.929557, -0.469883 is 10°C.",
  "thoughts": [
    "[debug]: @agent is attempting to call `agent1` tool",
    "Mona Gent-v1.0.0 called with lat:48.929557 long:-0.469883..."
  ]
}

When I ask for the level on sensor 1, which is served by MCP, nothing happens. I managed to do it with the app.

Did I miss something?

Are there known steps to reproduce?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    possible bugBug was reported but is not confirmed or is unable to be replicated.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions