Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -698,8 +698,8 @@ abstract class AbstractPromptIntegrationTest : KotlinTestBase() {

val expectedMessage = "Prompt not found: non-existent-prompt"

withClue("Exception code should be INTERNAL_ERROR: -32603") {
exception.code shouldBe -32603
withClue("Exception code should be INVALID_PARAMS: ${RPCError.ErrorCode.INVALID_PARAMS}") {
exception.code shouldBe RPCError.ErrorCode.INVALID_PARAMS
}
withClue("Unexpected error message for non-existent prompt") {
exception.message shouldBe expectedMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,10 @@ public open class Server(
val prompt = promptRegistry.get(requestParams.name)
?: run {
logger.error { "Prompt not found: ${requestParams.name}" }
throw IllegalArgumentException("Prompt not found: ${requestParams.name}")
throw McpException(
code = RPCError.ErrorCode.INVALID_PARAMS,
message = "Prompt not found: ${requestParams.name}",
)
}
return prompt.run {
session.clientConnection.messageProvider(request)
Expand Down