Class PreMcpToolCallHookOutput

java.lang.Object
com.github.copilot.rpc.PreMcpToolCallHookOutput

public class PreMcpToolCallHookOutput extends Object
Output for a pre-MCP-tool-call hook.

The metaToUse property controls outgoing MCP request metadata:

  • Return null from the hook handler: preserve existing _meta (no-op).
  • Return a PreMcpToolCallHookOutput with metaToUse left as null: remove _meta from the request.
  • Return a PreMcpToolCallHookOutput with metaToUse set to a JSON object: replace _meta with that object.
Since:
1.0.8
  • Constructor Details

    • PreMcpToolCallHookOutput

      public PreMcpToolCallHookOutput()
  • Method Details

    • getMetaToUse

      public com.fasterxml.jackson.databind.JsonNode getMetaToUse()
      Gets the metadata to use for the outgoing MCP request.
      Returns:
      the metadata JSON node, or null to remove metadata
    • setMetaToUse

      public PreMcpToolCallHookOutput setMetaToUse(com.fasterxml.jackson.databind.JsonNode metaToUse)
      Sets the metadata to use for the outgoing MCP request.
      Parameters:
      metaToUse - the metadata JSON node, or null to remove metadata
      Returns:
      this instance for method chaining
    • withMeta

      public static PreMcpToolCallHookOutput withMeta(com.fasterxml.jackson.databind.JsonNode metaToUse)
      Creates a hook output that sets the given metadata on the MCP request.
      Parameters:
      metaToUse - the metadata JSON node to use
      Returns:
      the hook output
    • removeMeta

      public static PreMcpToolCallHookOutput removeMeta()
      Creates a hook output that removes metadata from the MCP request.
      Returns:
      the hook output with null metaToUse