-
Notifications
You must be signed in to change notification settings - Fork 359
Description
I noticed that someone created the PR #229 before, but due to absent test case and further communication, it has been closed now.
This problem does exist indeed, I am facing it and also have known how to reproduce it. If the name of MCP server in the fastagent.config.yaml contains the separator -, such as mcp-server-example, it will cause a problem: Prompt not found 'mcp-server-example-my_prompt' on any server, when we select prompt from the [Available MCP Prompts] table. Change the value of constant SEP from - to :, the error message will disappear.
But it's not over yet. We can't replace the - with : simply and directly, because the symbol : will cause another problem: Error applying prompt: Error code: 400 - {'error': {'message': "Invalid 'tools[0].function.name': string does not match pattern. Expected a string that matches the pattern '^+$'.", 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_request_error'}}. I traced back the exception stack, this error message from the underlying openai-sdk, but the root cause is that fast-agent provided invalid prompt name with the symbol :, I guess only letters, digits, and underlines are valid.
I tried to change the value of constant SEP from - to __, two underlines, both of problems above disappeared. But this is not the final decision, I create this issue first to describe the problem.