{"record":{"id":"a5661542c53ee5ca","repo":"ComposioHQ/composio","slug":"proxy-execute-method-must-be-one-of-sorted-vali","errorCode":null,"errorMessage":"proxy_execute: method must be one of {sorted(_VALID_METHODS)}, got {method!r}","messagePattern":"proxy_execute: method must be one of (.+?), got (.+?)","errorType":"validation","errorClass":"ValidationError","httpStatus":null,"severity":"error","filePath":"python/composio/core/models/session_context.py","lineNumber":58,"sourceCode":"    *,\n    toolkit: str,\n    endpoint: str,\n    method: t.Literal[\"GET\", \"POST\", \"PUT\", \"DELETE\", \"PATCH\"],\n    body: t.Any = None,\n    parameters: t.Optional[t.List[t.Dict[str, t.Any]]] = None,\n) -> ToolRouterSessionProxyExecuteResponse:\n    \"\"\"Shared proxy execute implementation used by SessionContextImpl and ToolRouterSession.\n\n    Projects the generated client's response model onto the SDK's own shape so\n    the public return type does not move when the client is regenerated.\n    \"\"\"\n    # Client-side validation (matches TS SessionProxyExecuteParamsSchema)\n    if not toolkit:\n        raise ValidationError(\"proxy_execute: toolkit is required\")\n    if not endpoint:\n        raise ValidationError(\"proxy_execute: endpoint is required\")\n    if method not in _VALID_METHODS:\n        raise ValidationError(\n            f\"proxy_execute: method must be one of {sorted(_VALID_METHODS)}, got {method!r}\"\n        )\n\n    # Transform and validate parameters\n    api_params: t.List[Parameter] = []\n    if parameters:\n        for i, p in enumerate(parameters):\n            if not isinstance(p, dict) or \"name\" not in p or \"value\" not in p:\n                raise ValidationError(\n                    f\"proxy_execute: parameters[{i}] must be a dict with 'name' and 'value' keys\"\n                )\n            param_type = p.get(\"in\", p.get(\"type\", \"header\"))\n            if param_type not in _VALID_PARAM_TYPES:\n                raise ValidationError(\n                    f\"proxy_execute: parameters[{i}].type must be 'header' or 'query', \"\n                    f\"got {param_type!r}\"\n                )\n            api_params.append(","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/python/composio/core/models/session_context.py#L40-L76","documentation":"Client-side guard rejecting proxy_execute calls whose method is not in the allowed set (typically GET/POST/PUT/PATCH/DELETE). The message lists the valid options and echoes the offending value, so misconfigured methods are caught locally without a round-trip.","triggerScenarios":"Passing method='get' (lowercase), method='HEAD', or method=None to session.proxy_execute.","commonSituations":"Copy-pasting from HTTP snippets that use lowercase methods, or forwarding an arbitrary user-supplied method string.","solutions":["Use an uppercase allowed method, e.g. method='GET'","If accepting user input for method, validate it against the allowed set first"],"exampleFix":"# before\nsession.proxy_execute(toolkit='github', endpoint='/user', method='get')\n\n# after\nsession.proxy_execute(toolkit='github', endpoint='/user', method='GET')","handlingStrategy":"validation","validationCode":"ALLOWED = {'GET','POST','PUT','PATCH','DELETE'}\nmethod = method.upper()\nassert method in ALLOWED, f'method must be in {ALLOWED}'","typeGuard":"def is_valid_method(m: str) -> bool:\n    return m.upper() in {'GET','POST','PUT','PATCH','DELETE'}","tryCatchPattern":null,"preventionTips":["Normalize methods to uppercase","Validate user-supplied methods"],"tags":["python","session","validation","http-method"],"backgroundTag":"invalid-enum-value","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}