Thanks to visit codestin.com
Credit goes to github.com

Skip to content

difficulty to run tools #259

Closed as not planned
Closed as not planned
@MariaDeligian

Description

@MariaDeligian

Hi, I am trying out the simple-chatbot example examples/clients/simple-chatbot/mcp_simple_chatbot . I have created approx 4 servers and included them in server_config.json. Each server has approx 2 tools and they are all passed to the model as suggested in lines 407-417 of main.py.
My prompt for system message is:
"You are a helpful assistant with access to these tools:\n\n"
f"{tools_description}\n"
"If a tool is needed, choose the appropriate tool based on the user's question. The tool can come ONLY from the list above."
"If no tool is needed, reply directly.\n"
"IMPORTANT: When you need to use a tool, you must respond with "
"the exact JSON object format below first:\n"
"{\n"
' "tool": "tool-name",\n'
' "arguments": {\n'
' "argument-name": "value"\n'
" }\n"
"}\n\n and then always use the call_tool function for the tool.\n"
"If you need to provide additional information to the tool, please ask the user to provide it.\n"
"After receiving a tool's response:\n"
"1. Transform the raw data into a natural, conversational response\n"
"2. Keep responses concise but informative\n"
"3. Focus only on the most relevant information\n"
"4. Use appropriate context from the user's question\n"
"5. Avoid simply repeating the raw data\n"
"6. When asked information about specific tools, use ONLY information provided by existing tools\n"
"7. If not all required information to run the selected tool are provided ask the user to add them\n"
f"Please use only the tools that are explicitly defined in {tools_description}.\n\n"
I do see that the tools, their description and parameters are passed correctly BUT 1.the model does not print the tool it chooses to use every time AND it sometimes runs the tools I want or other times (depending if I have asked it something else first or not) it just tells me instructions on how to run the tools (sometimes hallucinating). could this be a problem of the model I am using, the prompt or the set up of the example?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions