MCP tools not called when using litellm and ollama #7639
snowstopxt
started this conversation in
Help Wanted
Replies: 1 comment 4 replies
-
I have the exact same issue, also using LibreChat with LiteLLM and Ollama, trying to call a SearXNG MCP server directly. librechat.yaml version: 1.2.5
cache: true
interface:
endpointsMenu: true
modelSelect: true
parameters: true # This is crucial - without it, the agent builder won't appear
sidePanel: true
agentBuilder: true
endpoints:
assistants:
disableBuilder: false
capabilities: ["tools", "actions", "retrieval", "code_interpreter", "image_vision"]
agents:
disableBuilder: false
capabilities: ["execute_code", "file_search", "actions", "tools", "ocr"]
actions:
allowedDomains:
- "litellm.ai-lab.de"
- "ai-lab.de"
custom:
- name: "LiteLLM"
apiKey: "sk-..."
baseURL: "https://litellm.ai-lab.de/v1"
models:
default: ["llama3.1:8b"]
fetch: true
titleConvo: true
titleModel: "current_model"
modelDisplayLabel: "LiteLLM"
capabilities: ["tools", "actions"]
agentOptions:
capabilities: ["tools", "actions"]
params:
tools: true
mcpServers:
searxng:
url: https://searxngmcp.ai-lab.de/sse
litellm config.yml: model_list:
- model_name: "llama3.1:8b"
litellm_params:
model: "ollama/llama3.1:8b"
api_base: "https://ollama.ai-lab.de"
temperature: 0.7
max_tokens: 4096
drop_params: true
- model_name: "gemma3:27b"
litellm_params:
model: "ollama/gemma3:27b"
api_base: "https://ollama.ai-lab.de"
temperature: 0.7
max_tokens: 32768 # or up to 128k if supported
drop_params: true
- model_name: "qwen3:32b"
litellm_params:
model: "ollama/qwen3:32b"
api_base: "https://ollama.ai-lab.de"
temperature: 0.7
max_tokens: 32768 # Adjust based on your Qwen3 model
drop_params: true
litellm_settings:
set_verbose: false
success_callback: ["langfuse"]
callbacks: ["langfuse"]
redact_user_api_key_info: true
prompt_dir: "./prompts"
global_disable_no_log_param: false
mcp_servers:
searxng_mcp:
url: "https://searxngmcp.ai-lab.de/sse"
general_settings:
store_model_in_db: true
store_prompts_in_spend_logs: true LiteLLM log of the user prompt and LLM answer, when trying to use MCP in qwen3 chat: Request: {
"user": "6821e947597a91903d7e2c4e",
"model": "qwen3:32b",
"tools": [
{
"type": "function",
"function": {
"name": "search_mcp_searxng",
"parameters": {
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"q"
],
"properties": {
"q": {
"type": "string"
},
...,
"additionalProperties": false
},
"description": "\n Perform a search using SearXNG with all supported parameters.\n "
}
}
],
"stream": true,
"messages": [
{
"role": "user",
"content": [
{
"text": "Who is the current pope?",
"type": "text"
}
]
}
]
} LLM Response: {
"id": "chatcmpl-e69b49ef-2fbe-4b7d-8bfb-8ce63e0a293f",
"model": "qwen3:32b",
"usage": {
"total_tokens": 705,
"prompt_tokens": 681,
"completion_tokens": 24,
"prompt_tokens_details": null,
"completion_tokens_details": {
"audio_tokens": null,
"reasoning_tokens": 0,
"accepted_prediction_tokens": null,
"rejected_prediction_tokens": null
}
},
"object": "chat.completion",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "{\"name\": \"search_mcp_searxng\", \"arguments\": {\"q\": \"current pope\"}}",
"tool_calls": null,
"function_call": null
},
"finish_reason": "stop"
}
],
"created": 1748844601,
"system_fingerprint": null
} I hope this provides some additional infos that might help fix this issue. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am using litellm proxy with these configs




and my librechat with these configs
I am trying to use the mcp tools defined in my fastapi_mcp server but am always met with an incorrect response and tools not being run correctly. Agents are also met with the same problem.
I am running everything in deploy-compose (including my mcp server) Any help will be appreciated, as I have been working on this for hours and am still not able to get it to work.
What I have tried:
Beta Was this translation helpful? Give feedback.
All reactions