Class RemoteOrderStatusTool
java.lang.Object
ai.redouble.nucleo.harness.AbstractJob<OrderStatus>
ai.redouble.nucleo.tools.AbstractTool<OrderNumber, OrderStatus>
ai.redouble.examples.mcpwrap.RemoteOrderStatusTool
- All Implemented Interfaces:
GuardedExecution, Identifiable, Job<OrderStatus>, Tool<OrderNumber, OrderStatus>
One tool of the orders MCP server wrapped as a tool of this application's own, with the
input and output classes fixed here: the same
OrderNumber in and
OrderStatus out as the local tool. Only the body reaches over the wire.
For a remote tool your workflows depend on, this is the right way, and the generic
call is for browsing. The contract is yours: rename a field on the server and agents on
the generic path quietly start seeing a different tool, while here the parse fails
loudly, in one place, with a typed seam to fix. Scopes and guardrails can judge typed
fields, where a claim inside a generic JSON blob is invisible to them. The
readOnly declaration is yours to assert, so a read-only agent may keep the tool -
a generic MCP tool is never read-only, because nothing can vouch for it. And a test hands
OrdersServer a fake and runs this without a network.
- Since:
- 0.1 (2026-09-28)
- Author:
- Andrey Santrosyan
-
Field Summary
Fields inherited from class AbstractTool
inputFields inherited from class AbstractJob
timeout, upstreamRetriesFields inherited from interface Job
DEFAULT_UPSTREAM_RETRIESFields inherited from interface Tool
OBS_INPUT, OBS_OUTPUT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecute(JobResources resources, JobContext<OrderStatus> context) Executes the job with the provided resources and context.Default requirements for tools.Methods inherited from class AbstractTool
getInput, getJobType, postExecute, preExecute, setInputMethods inherited from class AbstractJob
getId, getName, getParentJobId, getPriority, getTimeout, getUpstreamRetries, getUserId, getWorkflowId, randomIdSuffix, setTimeout, setUpstreamRetries, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface GuardedExecution
declareAdmissionGuardrails, declareAuthGuardrails, declareContentGuardrailsMethods inherited from interface Identifiable
getParentJobId, getUserId, getWorkflowIdMethods inherited from interface Job
getDisplayName, getId, getJobId, getName, getPriority, getTimeout, getUpstreamRetriesMethods inherited from interface Tool
guardedInputTarget
-
Constructor Details
-
RemoteOrderStatusTool
-
-
Method Details
-
getRequirements
Description copied from class:AbstractToolDefault requirements for tools. Subclasses should override to add database, LLM, or other requirements. JobType is handled byAbstractTool.getJobType(), not here.- Specified by:
getRequirementsin interfaceJob<OrderStatus>- Overrides:
getRequirementsin classAbstractTool<OrderNumber, OrderStatus>- Returns:
- resource requirements, or null if the job needs no resources
-
execute
public OrderStatus execute(JobResources resources, JobContext<OrderStatus> context) throws LLMReadableCheckedException Description copied from interface:JobExecutes the job with the provided resources and context. A job reports progress and checks for cancellation through the context, and completes all its work before returning. A tool narrows this contract to the LLM-readable exceptions ofTool.execute(JobResources, JobContext).- Parameters:
resources- the allocated resourcescontext- the job execution context for monitoring- Returns:
- the job result, which may be null
- Throws:
LLMReadableCheckedException- if execution fails
-