{"record":{"id":"f4fe9937df8b589f","repo":"quarkusio/quarkus","slug":"methodname-must-be-provided","errorCode":null,"errorMessage":"methodName must be provided","messagePattern":"methodName must be provided","errorType":"validation","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/devui/deployment-spi/src/main/java/io/quarkus/devui/spi/buildtime/BuildTimeActionBuildItem.java","lineNumber":190,"sourceCode":"        }\n\n        public <T> ActionBuilder assistantFunction(BiFunction<Object, Map<String, String>, ?> assistantFunction) {\n            if (this.function != null || this.runtimeValue != null)\n                throw new IllegalStateException(\"Only one of runtimeValue, function or assistantFunction is allowed\");\n            this.assistantFunction = assistantFunction;\n            return this;\n        }\n\n        public ActionBuilder runtime(RuntimeValue<?> runtimeValue) {\n            if (this.function != null || this.assistantFunction != null)\n                throw new IllegalStateException(\"Only one of runtimeValue, function or assistantFunction is allowed\");\n            this.runtimeValue = runtimeValue;\n            return this;\n        }\n\n        public BuildTimeActionBuildItem build() {\n            if (methodName == null || methodName.isBlank())\n                throw new IllegalStateException(\"methodName must be provided\");\n            if (parameters.isEmpty())\n                parameters = null;\n            if (function != null) {\n                return addAction(\n                        new DeploymentJsonRpcMethod(methodName, description, parameters, autoUsage(usage, description),\n                                mcpEnabledByDefault,\n                                function));\n            } else if (runtimeValue != null) {\n                return addAction(\n                        new RecordedJsonRpcMethod(methodName, description, autoUsage(usage, description),\n                                mcpEnabledByDefault,\n                                runtimeValue));\n            } else if (assistantFunction != null) {\n                return addAction(\n                        new DeploymentJsonRpcMethod(methodName, description, parameters, autoUsage(usage, description),\n                                mcpEnabledByDefault,\n                                assistantFunction));\n            } else {","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/devui/deployment-spi/src/main/java/io/quarkus/devui/spi/buildtime/BuildTimeActionBuildItem.java#L172-L208","documentation":"Thrown by BuildTimeActionBuildItem.ActionBuilder.build when a build-time JSON-RPC action is registered without a method name. The method name is the key the Dev UI / MCP endpoint uses to route invocations; an action with a blank methodName cannot be addressed, so the build-time guard rejects the contribution during extension build.","triggerScenarios":"Calling ActionBuilder.build() without ActionBuilder.methodName(String).","commonSituations":"Building the item programmatically where the method name comes from config or a constant that is unexpectedly empty/null.","solutions":["Call .methodName(\"yourAction\") before build()","If the name is dynamic, validate/fail-fast that it is non-blank upstream"],"exampleFix":"// before\nBuildTimeActionBuildItem item = new BuildTimeActionBuildItem(\"my-extension\")\n    .build();\n// after\nBuildTimeActionBuildItem item = new BuildTimeActionBuildItem(\"my-extension\")\n    .methodName(\"getInfo\")\n    .runtime(runtimeValue)\n    .build();","handlingStrategy":"validation","validationCode":"if (methodName == null || methodName.isBlank()) {\n    throw new IllegalArgumentException(\"Action methodName must be non-blank\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    item = actionBuilder.build();\n} catch (IllegalStateException e) {\n    if (e.getMessage().contains(\"methodName must be provided\")) { /* supply methodName */ }\n    else throw e;\n}","preventionTips":["Always call methodName() first in the builder chain","Fail fast on dynamic names before passing them in","Cover Dev UI action registration with a deployment-time test"],"tags":["quarkus","devui","jsonrpc","builder-validation"],"backgroundTag":"missing-required-argument","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}