invoke_tool vs solve_task on ToolYour MCP
Optimizing your AI agent's interaction with tools is crucial for efficiency and reliability. ToolYour's Model Context Protocol (MCP) offers two primary methods for agents to leverage its practical tools: solve_task and invoke_tool. Understanding the distinctions between these two approaches, particularly for invoke_tool MCP, helps agent builders make informed decisions for different scenarios.
This guide provides a neutral comparison to help you determine which method best suits your agent's needs, focusing on control, reliability, and desired outcomes.
What solve_task optimizes for
solve_task is designed for higher-level, goal-oriented operations. It enables your agent to articulate a desired outcome, and then ToolYour's MCP server attempts to determine the optimal sequence of tools and parameters required to achieve that goal. This approach is ideal when your agent needs to perform complex actions without explicit knowledge of individual tool mechanics.
For example, an agent might submit a goal like:
{
"goal": "Audit the SEO of `https://yoursite.com/page` and identify keyword opportunities.",
"inputs": {
"url": "https://yoursite.com/page"
}
}
ToolYour's MCP would then attempt to orchestrate a workflow, potentially involving multiple internal tools such as page-speed-analyzer, seo-audit, and keyword-opportunity-review-job, to fulfill the request. This abstraction simplifies agent development by offloading the task decomposition and tool chaining to the ToolYour MCP server.
Important Note on solve_task Maturity:
solve_task is currently in an early phase. ToolYour is regularly upgrading existing tools and adding new MCP workflows, which means its routing, workflows, and overall tool coverage are continuously improving. Due to its evolving nature, it is common for solve_task requests to return a status: suggest result, offering recommended next steps rather than immediate execution. For production-critical workflows where deterministic outcomes are essential, the discover_tools → get_tool_schema → invoke_tool path is currently the more reliable option. To learn more about how solve_task works, refer to our dedicated guide on How solve_task Works on ToolYour MCP.
When invoke_tool is clearer
invoke_tool provides direct, explicit control over which ToolYour tool your agent executes and with precisely what parameters. This method is clearer when your agent already knows which specific tool it needs to call and has all the necessary inputs. It’s the direct equivalent of calling a specific function in a library or an endpoint in a REST API.
Use invoke_tool when:
- Precision and Reliability are Paramount: For production-critical applications,
invoke_tooloffers predictable execution. Your agent directly controls the tool's behavior, ensuring the exact intended action is performed. - Known Tool, Known Parameters: If your agent has already identified the exact tool (e.g.,
seo-audit,image-compressor,docx-to-pdf-converter) and has all the required input arguments,invoke_toolstreamlines the execution. - Deterministic Outcomes are Required: Unlike
solve_taskwhich might return a suggestion,invoke_toolaims for immediate execution based on the provided inputs. - Integration with Agent's Internal Logic: When your agent's internal reasoning engine is responsible for tool selection and parameter generation,
invoke_toolfits seamlessly into that existing logic.
The workflow typically involves your agent first discovering available tools and their schemas, then making a direct invoke_tool call. An example of invoking a tool might look like:
{
"tool_id": "seo-audit",
"parameters": {
"targetUrl": "https://yoursite.com/report",
"depth": 2
}
}
This direct invocation guarantees that the seo-audit tool is called with the specified targetUrl and depth, without any intermediary interpretation or workflow orchestration by the MCP server.
Pairing with discover_tools
The most robust and recommended path for production-grade agent integrations on ToolYour MCP is to pair invoke_tool with the discovery meta-tools: discover_tools and get_tool_schema. This combination allows your agent to dynamically find and understand available tools before making a direct, explicit call.
Here's how this pathway generally works:
- Agent Goal: Your agent receives a request, such as "Generate a summary of the provided audio file."
discover_tools: Your agent callsdiscover_toolsto find relevant tools. This meta-tool allows filtering by keywords, categories, or skills. For instance, your agent might search for tools related to "audio" and "summarize."
- To learn more about finding tools, refer to our guide on discover_tools: Find Tools in Your MCP Agent.
get_tool_schema: Once potential tools are identified (e.g.,ai-audio-summarizer), your agent callsget_tool_schemafor the chosen tool. This provides the full JSON schema of the tool's expected inputs, outputs, and any constraints.
- Example:
get_tool_schemaforai-audio-summarizermight reveal it requires anaudioFileUrland an optionalsummaryLength.
-
Parameter Generation: Your agent uses the schema to formulate the correct parameters based on the initial request and available context.
-
invoke_tool: Finally, your agent makes a directinvoke_toolcall with the specifictool_idand the correctly formattedparameters.
This multi-step approach ensures your agent has the necessary information to interact with tools precisely, minimizing errors and maximizing the reliability of your automated workflows. It leverages the dynamic capabilities of the MCP to adapt to new tools or updated schemas without requiring code changes in your agent for every tool.
Decision Guide: invoke_tool vs solve_task
Choosing between invoke_tool and solve_task depends on your agent's design, the task's complexity, and the required level of control and predictability.
| Feature | solve_task | invoke_tool (often with discover_tools path) |
| :------------------ | :-------------------------------------------------------------------------------- | :------------------------------------------------------------------------------- |
| Control Level | High-level, goal-oriented. Agent specifies desired outcome. | Low-level, explicit. Agent specifies exact tool and parameters. |
| Maturity (MCP) | Early phase. Routing and workflows are evolving. Expect status: suggest often. | Mature and reliable. Direct execution based on provided inputs. |
| Complexity | Handles multi-tool orchestration internally. Agent provides high-level goal. | Agent responsible for tool selection, parameter generation, and chaining. |
| Predictability | Can be less predictable due to early phase; may offer suggestions. | Highly predictable and deterministic; directly executes the specified tool. |
| Use Case | Exploring possibilities, prototyping complex workflows, general problem-solving. | Production-critical tasks, known tool invocations, precise data processing. |
| Output Type | Result of the overall task, or a suggestion for next steps. | Direct output of the specific tool called. |
| Agent's Role | Provides goal, processes final outcome or suggestions. | Discovers, analyzes schema, generates parameters, calls tool, processes output. |
For most production-grade integrations with ToolYour MCP requiring consistent and reliable execution, the discover_tools → get_tool_schema → invoke_tool pattern is the recommended approach. solve_task is an excellent choice for scenarios where you want the ToolYour MCP to handle the routing logic, particularly during development or for tasks where an exact, pre-defined workflow isn't critical.
Quota implications
Understanding how ToolYour MCP usage affects your account's quota is essential for managing your agent's operations. Both invoke_tool and solve_task requests consume credits from your monthly allowance, but there are important distinctions:
- Shared Quota: All API keys under a single ToolYour account share the same monthly quota. This quota is also shared across both REST API calls and MCP tool executions.
- Free Plan Limits: The Free plan includes 500 credits (or credits, depending on tool cost) per month. Additionally, there's a throughput limit of 5 successful requests per minute.
- Quota Reset: Your quota resets on the 1st of each calendar month.
- Successful Calls Only: Generally, only successful tool calls count against your quota. Invalid requests that fail due to malformed input or authentication issues typically do not consume credits.
- Credit Cost: Tools on ToolYour can cost between 1 to 10 credits per call, depending on their complexity and resource usage.
- MCP Specifics:
- Catalog Exploration is Free: Browsing and exploring the ToolYour MCP catalog using meta-tools like
discover_toolsorlist_categoriesdoes not consume any credits. This allows your agent to dynamically learn about available tools without impacting your quota. - Tool Execution Counts: Running a tool through MCP, whether via
invoke_toolorsolve_task, consumes credits (weighted 1-10 per call) from your monthly allowance, just like a REST API call. Do not assumesolve_taskitself is free; only the exploratory phases are. - Exceeding Limits: If your agent exceeds the monthly credits limit for your plan, further requests will be blocked until you upgrade your plan or until your quota resets on the 1st of the next calendar month. ToolYour does not use pay-as-you-go billing for overage charges.
For detailed information on plans and usage, visit ToolYour Developers Documentation.
Examples
To illustrate the practical differences, let's look at how an agent might approach a similar task using both solve_task and the discover_tools → get_tool_schema → invoke_tool pattern.
Scenario: Convert a Word document to PDF
Goal: Convert a Microsoft Word document (report.docx) to a PDF file.
Using solve_task (Goal-Oriented)
An agent using solve_task would submit a high-level goal:
POST https://api.toolyour.com/mcp
X-Api-Key: ty_YOUR_API_KEY
Content-Type: application/json
{
"tool_id": "solve_task",
"parameters": {
"goal": "Convert this Word document to PDF.",
"inputs": {
"fileUrl": "`https://yourcompany.com/documents/report.docx`"
}
}
}
The ToolYour MCP server would then attempt to identify the appropriate tool (likely docx-to-pdf-converter) and execute it. Given solve_task's early phase, the response might be a suggestion:
{
"status": "suggest",
"suggestions": [
{
"tool_id": "docx-to-pdf-converter",
"parameters": {
"inputFileUrl": "`https://yourcompany.com/documents/report.docx`"
}
}
],
"reason": "Identified 'docx-to-pdf-converter' as the most suitable tool."
}
The agent would then need to handle this suggestion, potentially by invoking the suggested tool directly.
Using discover_tools → get_tool_schema → invoke_tool (Explicit Control)
An agent taking the explicit control path would follow these steps:
- Discover Tools:
The agent first calls
discover_toolsto find relevant tools for document conversion:
POST https://api.toolyour.com/mcp
X-Api-Key: ty_YOUR_API_KEY
Content-Type: application/json
{
"tool_id": "discover_tools",
"parameters": {
"keywords": "document conversion",
"category": "file-conversion"
}
}
The response would include tools like docx-to-pdf-converter.
- Get Tool Schema:
Assuming
docx-to-pdf-converteris identified, the agent then callsget_tool_schemafor it:
POST https://api.toolyour.com/mcp
X-Api-Key: ty_YOUR_API_KEY
Content-Type: application/json
{
"tool_id": "get_tool_schema",
"parameters": {
"toolId": "docx-to-pdf-converter"
}
}
The response would detail the docx-to-pdf-converter's required parameters (e.g., inputFileUrl).
- Invoke Tool:
With the
tool_idand schema confirmed, the agent directly invokes the tool:
POST https://api.toolyour.com/mcp
X-Api-Key: ty_YOUR_API_KEY
Content-Type: application/json
{
"tool_id": "docx-to-pdf-converter",
"parameters": {
"inputFileUrl": "`https://yourcompany.com/documents/report.docx`"
}
}
This direct call would lead to the execution of the tool, returning the PDF output or a URL to it. This approach provides a clear, step-by-step process, ensuring the agent has full control over the specific tool being used and its inputs. For full client setup details and more examples, visit the ToolYour MCP developer documentation.
FAQ
Q1: What are the primary differences between invoke_tool and solve_task?
A1: invoke_tool provides direct, explicit control to execute a specific ToolYour tool with predefined parameters, ideal for predictable outcomes. solve_task allows your agent to express a high-level goal, with the ToolYour MCP server attempting to determine and execute the necessary tool sequence, though it's currently in an early phase and may often suggest tools rather than execute directly.
Q2: When should I prefer invoke_tool for my agent on ToolYour MCP?
A2: You should prefer invoke_tool when your agent requires precise control, knows the exact tool and its parameters, and needs highly predictable and reliable execution, especially for production-critical workflows. This is often paired with discover_tools and get_tool_schema to dynamically find tool information.
Q3: Is solve_task reliable for production use today?
A3: solve_task is in an early phase. While it's continuously improving, its routing and workflow coverage are still evolving. For production-critical flows, ToolYour recommends the discover_tools → get_tool_schema → invoke_tool path to ensure deterministic and reliable execution. solve_task is better suited for exploration or non-critical tasks where status: suggest is acceptable.
Q4: Do discover_tools and get_tool_schema calls count against my quota?
A4: No, browsing and exploring the ToolYour MCP catalog using meta-tools like discover_tools, list_categories, or get_tool_schema does not consume any credits. Only the actual execution of tools (via invoke_tool or solve_task) counts against your monthly allowance.
Q5: How many requests can I make on the Free plan, and what happens if I exceed it? A5: The Free plan allows for 500 free credits per month, shared across REST and MCP usage, with a throughput limit of 5 successful requests per minute. If you exceed this limit, further requests will be blocked until you upgrade your plan or until your quota resets on the 1st of the next calendar month. There are no pay-as-you-go overage charges.
Q6: Can ToolYour MCP agents access all tools available on the ToolYour website?
A6: No, ToolYour MCP exposes only API-backed tools. Certain website-only tools that do not have a programmatic interface are not available through the MCP endpoint at https://api.toolyour.com/mcp.
Conclusion
The choice between invoke_tool and solve_task on ToolYour MCP significantly impacts your agent's autonomy, control, and reliability. For agent builders prioritizing precision and deterministic outcomes in critical applications, the discover_tools → get_tool_schema → invoke_tool pathway represents the most robust and mature integration strategy for invoke_tool MCP. This allows your agent to dynamically adapt to available tools while retaining explicit control over execution.
While solve_task offers an intuitive, goal-oriented approach and continues to evolve, its early phase maturity means status: suggest responses are common. For less critical or exploratory tasks, it can be a valuable option, but for production, direct invocation remains the standard.
To begin integrating ToolYour tools into your agent workflows, explore the ToolYour Developers Documentation and set up your MCP client using the guidelines at https://www.toolyour.com/developers/mcp.
