java.lang.Object
com.github.copilot.rpc.PreMcpToolCallHookInput
Input for a pre-MCP-tool-call hook.
This hook fires before an MCP tool call is dispatched to an MCP server, allowing you to inspect or modify the request metadata.
- Since:
- 1.0.8
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.fasterxml.jackson.databind.JsonNodeGets the arguments for the MCP tool call.getCwd()Gets the current working directory.getMeta()Gets the MCP request metadata, if present.Gets the name of the MCP server being called.Gets the runtime session ID of the session that triggered the hook.longGets the timestamp of the hook invocation.Gets the tool call ID, if available.Gets the name of the MCP tool being called.setArguments(com.fasterxml.jackson.databind.JsonNode arguments) Sets the arguments for the MCP tool call.Sets the current working directory.Sets the MCP request metadata.setServerName(String serverName) Sets the name of the MCP server being called.setSessionId(String sessionId) Sets the runtime session ID of the session that triggered the hook.setTimestamp(long timestamp) Sets the timestamp of the hook invocation.setToolCallId(String toolCallId) Sets the tool call ID.setToolName(String toolName) Sets the name of the MCP tool being called.
-
Constructor Details
-
PreMcpToolCallHookInput
public PreMcpToolCallHookInput()
-
-
Method Details
-
getSessionId
Gets the runtime session ID of the session that triggered the hook.- Returns:
- the session ID
-
setSessionId
Sets the runtime session ID of the session that triggered the hook.- Parameters:
sessionId- the session ID- Returns:
- this instance for method chaining
-
getTimestamp
public long getTimestamp()Gets the timestamp of the hook invocation.- Returns:
- the timestamp in milliseconds
-
setTimestamp
Sets the timestamp of the hook invocation.- Parameters:
timestamp- the timestamp in milliseconds- Returns:
- this instance for method chaining
-
getCwd
Gets the current working directory.- Returns:
- the working directory path
-
setCwd
Sets the current working directory.- Parameters:
cwd- the working directory path- Returns:
- this instance for method chaining
-
getServerName
Gets the name of the MCP server being called.- Returns:
- the server name
-
setServerName
Sets the name of the MCP server being called.- Parameters:
serverName- the server name- Returns:
- this instance for method chaining
-
getToolName
Gets the name of the MCP tool being called.- Returns:
- the tool name
-
setToolName
Sets the name of the MCP tool being called.- Parameters:
toolName- the tool name- Returns:
- this instance for method chaining
-
getArguments
public com.fasterxml.jackson.databind.JsonNode getArguments()Gets the arguments for the MCP tool call.- Returns:
- the arguments as a JSON node, or
null
-
setArguments
Sets the arguments for the MCP tool call.- Parameters:
arguments- the arguments as a JSON node- Returns:
- this instance for method chaining
-
getToolCallId
Gets the tool call ID, if available.- Returns:
- the tool call ID, or
null
-
setToolCallId
Sets the tool call ID.- Parameters:
toolCallId- the tool call ID- Returns:
- this instance for method chaining
-
getMeta
Gets the MCP request metadata, if present.- Returns:
- the metadata map, or
null
-
setMeta
Sets the MCP request metadata.- Parameters:
meta- the metadata map- Returns:
- this instance for method chaining
-