Skip to content

Output Formats#

All Method tools output data in a standardized schema that we call a Signal. You can see the Go struct here that defines the Signal but it consists of several properties:

  • content
  • This is the data that was generated by the specific tool and command that was called. The format of the content itself is unique to the command, and Method has no requirements as to the particular shape or values within the returned data.
  • started_at
  • The unix timestamp when the tool started to run.
  • completed_at
  • The unix timestamp when the tool completed it's run. This field is allowed to be empty, but tool author's should make every attempt to fill the value out, even on a failed run.
  • status
  • The unix status code for the run. Most commonly the value of this field will be either 1 or 0, but tool author's can leverage additional values if they would like to communicate more granular failure codes.
  • error_message
  • An optional error message to be returned to the caller. This can be useful when integrating tool outputs into automated workflows where a propagated error message could provide valuable context.

Method tools provide three different output formats to convey this information.

Signal#

A JSON representation of the Signal schema where the value of the content key is a Base64 encoded string of the tool output. This allows tools that do not output JSON to be incorporated into automation workflows.

JSON#

A JSON representation of the Signal schema, where the JSON formatted output of the tool command is included as the value of the content key.

YAML#

A YAML representation of the Signal schema, where the YAML formatted output of the tool command is included as the value of the content key.