Class McpArgs
java.lang.Object
com.codename1.backend.mcp.McpArgs
The conversions the build's generated tool and operation adapters use: one argument out of a call's argument map, as the type the method declares.
Accepts what an agent or an HTTP client actually sends -- a JSON number or a
numeric string, a JSON boolean or "true" -- and refuses anything else with an
IllegalArgumentException naming the argument, which the MCP endpoint
reports to the agent as a tool error it can correct.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Objectstatic BooleanbooleanObject(Map args, String name, boolean required) static booleanbooleanValue(Map args, String name, boolean required) static BytebyteObject(Map args, String name, boolean required) static byteA byte argument, refused outside the byte range for the same reason.static CharactercharacterObject(Map args, String name, boolean required) static charstatic DoubledoubleObject(Map args, String name, boolean required) static doubledoubleValue(Map args, String name, boolean required) static ObjectThe constant ofvalues-- an enum's values() -- that the argument names.static FloatfloatObject(Map args, String name, boolean required) static floatfloatValue(Map args, String name, boolean required) A float argument, refused when it has no float value: a finite number such as 1e100 would otherwise narrow to infinity, and the method would run with a number nobody sent.static IntegerintegerObject(Map args, String name, boolean required) static intstatic Liststatic LonglongObject(Map args, String name, boolean required) static longstatic Mapstatic MapAn object schema.static MapOne property of an input schema.static ShortshortObject(Map args, String name, boolean required) static shortshortValue(Map args, String name, boolean required) A short argument, refused outside the short range rather than narrowed: a cast would turn 40000 into -25536 and run the tool with a number nobody sent.static StringA string argument.static doubleA boxed number as a double, NaN for null.
-
Method Details
-
property
-
object
-
any
-
string
A string argument. A number or boolean is taken as its text, as Jackson coerces a scalar for Spring; an array or object is refused. Its Java text --[value],{id=value}-- is not what the caller sent, and a malformed call would run a side-effecting tool with an identifier nobody meant, where the schema promised a JSON string. -
longValue
-
intValue
-
shortValue
-
byteValue
-
doubleValue
-
booleanValue
-
charValue
-
integerObject
-
longObject
-
shortObject
-
byteObject
-
doubleObject
-
floatObject
-
floatValue
-
booleanObject
-
characterObject
-
map
-
list
-
enumValue
-
toDouble
A boxed number as a double, NaN for null.
-