{"record":{"id":"8efb1501e5519e16","repo":"microsoft/autogen","slug":"name-is-required-for-get-prompt","errorCode":null,"errorMessage":"name is required for get_prompt","messagePattern":"name is required for get_prompt","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/packages/autogen-ext/src/autogen_ext/tools/mcp/_actor.py","lineNumber":121,"sourceCode":"        fut: asyncio.Future[McpFuture] = asyncio.Future()\n        if type in {\"list_tools\", \"list_prompts\", \"list_resources\", \"list_resource_templates\", \"shutdown\"}:\n            await self._command_queue.put({\"type\": type, \"future\": fut})\n            res = await fut\n        elif type in {\"call_tool\", \"read_resource\", \"get_prompt\"}:\n            if args is None:\n                raise ValueError(f\"args is required for {type}\")\n            name = args.get(\"name\", None)\n            kwargs = args.get(\"kargs\", {})\n            if type == \"call_tool\" and name is None:\n                raise ValueError(\"name is required for call_tool\")\n            elif type == \"read_resource\":\n                uri = kwargs.get(\"uri\", None)\n                if uri is None:\n                    raise ValueError(\"uri is required for read_resource\")\n                await self._command_queue.put({\"type\": type, \"uri\": uri, \"future\": fut})\n            elif type == \"get_prompt\":\n                if name is None:\n                    raise ValueError(\"name is required for get_prompt\")\n                prompt_args = kwargs.get(\"arguments\", None)\n                await self._command_queue.put({\"type\": type, \"name\": name, \"args\": prompt_args, \"future\": fut})\n            else:  # call_tool\n                await self._command_queue.put({\"type\": type, \"name\": name, \"args\": kwargs, \"future\": fut})\n            res = await fut\n        else:\n            raise ValueError(f\"Unknown command type: {type}\")\n        return res\n\n    async def close(self) -> None:\n        if not self._active or self._actor_task is None:\n            return\n        self._shutdown_future = asyncio.Future()\n        await self._command_queue.put({\"type\": \"shutdown\", \"future\": self._shutdown_future})\n        await self._shutdown_future\n        await self._actor_task\n        self._active = False\n","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/python/packages/autogen-ext/src/autogen_ext/tools/mcp/_actor.py#L103-L139","documentation":"For type == 'get_prompt', McpActor.call() requires a non-None 'name' in the args dict; otherwise ValueError('name is required for get_prompt') is raised. The name identifies which server-side prompt template to render; optional template variables travel under args['kargs']['arguments'].","triggerScenarios":"Calling actor.call('get_prompt', args={'kargs': {'arguments': {...}}}) with no 'name', or with the prompt id stored under a different key such as 'prompt'.","commonSituations":"Passing prompt variables but forgetting the prompt identifier; using 'prompt' as the key after reading the MCP spec's prompts/get shape where it is called 'name'; empty-string prompt name (falsy only if None — but a missing key yields None).","solutions":["Include the prompt name: args={'name': 'code_review', 'kargs': {'arguments': {'language': 'python'}}}.","Get valid names from actor.call('list_prompts') first.","Match the key exactly: 'name', with variables nested under kargs['arguments']."],"exampleFix":"# before\nawait actor.call(\"get_prompt\", args={\"kargs\": {\"arguments\": {\"language\": \"python\"}}})\n\n# after\nawait actor.call(\"get_prompt\", args={\"name\": \"code_review\", \"kargs\": {\"arguments\": {\"language\": \"python\"}}})","handlingStrategy":"validation","validationCode":"if cmd == \"get_prompt\" and not args.get(\"name\"):\n    raise ValueError(\"get_prompt requires args['name']\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["List prompts first and pass result.name into the call.","Keep prompt names in constants next to your actor wrapper."],"tags":["mcp","validation","prompts","arguments"],"backgroundTag":null,"analyzedSha":"027ecf0a379bcc1d09956d46d12d44a3ad9cee14","analyzedAt":"2026-08-15T03:38:00.719Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}