Call an MCP tool from the terminal without an AI client
List the tools of an integration with metorial tools, read the input schema with metorial schema, and run one with metorial call -d. The output is JSON.
To call a tool from the terminal, run metorial tools <integration-id> to get its name, metorial schema <integration-id> <tool-key> to see what input it takes, and metorial call <integration-id> <tool-key> -d '<json>' to run it. The call goes over MCP to the same endpoint your AI client uses, with your own connected account, so it is a quick way to test an integration or script a task.
What you'll learn
- How to list an integration's tools
- How to read a tool's input schema
- How to call a tool with inline JSON or from stdin
Before you start
- The
metorialCLI, signed in to your portal (install and sign in) - A connected integration (connect an app)
Find the integration ID
Use the ID from the Name column, or the endpoint alias. Both work wherever a command asks for <integration-id>.
List the tools
The CLI connects to the integration over MCP and prints the tools it offers at that moment, with three columns: Name, Title and Description. The value in Name is the tool key you pass to schema and call.
This list already reflects the tool permissions your administrator set. A tool that is blocked for you does not appear.
Read the input schema
The output is the tool's JSON Schema. Look at properties for the fields and required for the ones you must send. schema prints JSON even without --format json, so you can pipe it:
Call the tool
Pass the input as a JSON object with -d:
The CLI checks your input against the schema before it sends anything. If the input is valid, it calls the tool and prints the result as JSON.
A tool that takes no input can be called without -d:
Read the input from stdin
For larger inputs, keep the JSON in a file and pipe it in. Use -d @- to read stdin, or leave -d out when you pipe.
Use the result in a script
call writes the result to stdout as JSON and errors to stderr, and it exits with a non-zero code when the tool reports an error.
Pass --format yaml or --format toml if you prefer those to JSON.
Check it worked
A successful call prints the tool's result and exits with code 0. Your administrator can see the same call in the dashboard under Logs, Tool Calls, with your account as the caller.
Troubleshooting
metorial: tool "<tool-key>" was not found on this integration
The key does not match a tool on this integration. Copy it from the Name column of metorial tools. If the tool used to be there, your administrator may have blocked it.
Input parsing failed
The CLI adds "Tool input must be valid JSON." Check the quoting. In most shells, wrap the JSON in single quotes.
Input shape is invalid
The CLI adds "Tool input must be a JSON object at the top level." Send {...}, not an array or a bare string.
Input validation failed
The input is JSON but does not match the tool's schema. The message names the tool, explains why under Why, and repeats what you sent under Input Preview. Compare it with metorial schema.
Tool call failed
The tool ran and the app returned an error. Read Server Message. A permission or authentication error from the app usually means your connection needs a refresh: run metorial reconnect <catalog-item-id>.