Tools Reference
Current tool contracts exposed by the MCP Gateway
All tools return JSON content through standard MCP tool responses. Tool names are a stable contract: tools are added, but a published name does not change.
Titles and Behavior Hints#
Every tool carries a display title and MCP annotations in tools/list.
Clients use the hints to decide when to ask before a call: read-only tools run
without a prompt, and tools that change data can ask first.
| Tool | Title | Read only | Destructive | Idempotent | Open world |
|---|---|---|---|---|---|
lovelace_list_workspaces | List workspaces | yes | no | yes | no |
lovelace_get_workspace | Get workspace details | yes | no | yes | no |
lovelace_list_agents | List agents | yes | no | yes | no |
lovelace_spawn_agent | Start a cloud agent | no | no | no | yes |
lovelace_get_agent_status | Get agent status | yes | no | yes | no |
lovelace_get_agent_result | Get agent result | yes | no | yes | no |
lovelace_search_knowledge | Search saved knowledge | yes | no | yes | no |
lovelace_store_knowledge | Save knowledge | no | no | no | no |
lovelace_spawn_agent and lovelace_store_knowledge add new items and change
nothing that exists. A started agent may reach sources outside your Lovelace
account while it works, so its tool is marked open world.
The Default Workspace#
Every workspace-scoped tool takes an optional workspaceId. A call that names
no workspace uses your default workspace: the first workspace you created. An
account with no workspace gets one named Personal the first time any tool needs
it, so a new account can save and search knowledge right after it connects.
lovelace_list_workspaces marks the default with isDefault.
When a request carries an X-Workspace-Id header, calls that name no
workspace use that workspace instead, and calls that name a different one are
refused.
Workspace Tools#
lovelace_list_workspaces#
List the workspaces you own. Creates your default workspace first if you have none.
- Input: none
- Required scopes:
workspace:reador equivalentmcp:read/read
Output
{
"workspaces": [
{
"id": "ws_abc123",
"name": "Personal",
"description": null,
"isDefault": true,
"memberCount": 1,
"createdAt": "2025-01-15T10:00:00.000Z"
}
],
"defaultWorkspaceId": "ws_abc123",
"total": 1
}
lovelace_get_workspace#
Get details for one workspace. Without workspaceId, returns your default
workspace.
- Required scopes:
workspace:reador equivalentmcp:read/read
Input
{
"workspaceId": "ws_abc123"
}
Output
{
"id": "ws_abc123",
"name": "My Project",
"description": "Main development workspace",
"ownerId": "user_123",
"memberCount": 3,
"createdAt": "2025-01-15T10:00:00.000Z",
"updatedAt": "2025-02-01T14:30:00.000Z"
}
Agent Tools#
Agents run in Lovelace's cloud, not on your computer. Starting an agent gives it one task, and the agent tools report where that task stands with one status vocabulary:
| Status | Meaning | Final |
|---|---|---|
working | The agent has a task it has not finished, queued or running | no |
succeeded | The agent finished its task; lovelace_get_agent_result has the text | yes |
failed | The task failed or ran out of time, or the agent failed | yes |
stopped | The task was cancelled, or the agent was stopped before it had a task | yes |
idle | The agent has no task and has not stopped, so nothing will finish | no |
Poll lovelace_get_agent_status while the status is working, then call
lovelace_get_agent_result once it is final.
lovelace_list_agents#
List the agents in a workspace. Without workspaceId, lists the agents in your
default workspace.
- Required scopes:
agents:reador equivalentmcp:read/read
Input
{
"workspaceId": "ws_abc123"
}
Output
{
"workspaceId": "ws_abc123",
"agents": [
{
"id": "agent_123",
"name": "API Review Agent",
"description": "Performance review run",
"type": "general",
"task": "Review API bottlenecks",
"status": "succeeded",
"workspaceId": "ws_abc123",
"createdAt": "2025-02-17T12:00:00.000Z",
"updatedAt": "2025-02-17T12:05:30.000Z"
}
],
"total": 1
}
lovelace_spawn_agent#
Start an agent and give it a task. The agent keeps working after the call
returns, so the status is working. task holds everything the agent needs,
up to 5,000 characters. Without workspaceId, the agent starts in your default
workspace.
The task runs for as long as the agent's execution limit allows. Your Lovelace
plan sets that limit. A task that is still working when the limit is reached
ends as failed with an error saying the agent ran out of time.
- Required scopes:
agents:writeor equivalentmcp:write/write
Input
{
"agentType": "general",
"task": "Review the authentication module for security issues",
"config": {
"priority": "high"
}
}
Output
{
"agentId": "agent_123",
"status": "working",
"workspaceId": "ws_abc123"
}
lovelace_get_agent_status#
Get where an agent's work stands. The status is one of the values in the table
above; completedAt is set once it is succeeded, failed, or stopped.
- Required scopes:
agents:reador equivalentmcp:read/read
Input
{
"agentId": "agent_123"
}
workspaceId is optional and defaults to your default workspace.
Output
{
"id": "agent_123",
"name": "API Review Agent",
"description": "Performance review run",
"type": "general",
"task": "Review API bottlenecks",
"status": "succeeded",
"workspaceId": "ws_abc123",
"createdAt": "2025-02-17T12:00:00.000Z",
"updatedAt": "2025-02-17T12:05:30.000Z",
"completedAt": "2025-02-17T12:05:30.000Z"
}
lovelace_get_agent_result#
Get an agent's final output. When the status is succeeded, result is the
text the agent produced. When it is failed or stopped, error says why and
there is no result. While it is working or idle, neither is set.
- Required scopes:
agents:reador equivalentmcp:read/read
Input
{
"agentId": "agent_123"
}
workspaceId is optional and defaults to your default workspace.
Output
{
"agentId": "agent_123",
"status": "succeeded",
"result": "The two slowest endpoints are /search and /export...",
"completedAt": "2025-02-17T12:05:30.000Z"
}
An agent that failed:
{
"agentId": "agent_123",
"status": "failed",
"error": "The agent ran out of time before it finished its task.",
"completedAt": "2025-02-17T12:05:30.000Z"
}
Knowledge Tools#
Knowledge is text you save to a workspace and find again by search.
lovelace_search_knowledge#
Search saved knowledge. Matches entries that share any word of the query, after
English stemming and common-word removal, or that contain the whole query as a
substring. Without workspaceId, searches your default workspace.
- Required scopes:
knowledge:reador equivalentmcp:read/read
Input
{
"query": "authentication best practices",
"limit": 5
}
limit is 1 to 50 and defaults to 10.
Output
{
"workspaceId": "ws_abc123",
"query": "authentication best practices",
"results": [
{
"documentId": "doc_456",
"title": "Authentication Architecture",
"score": 0.4,
"snippet": "Our **authentication** system uses OAuth 2.1 with PKCE...",
"mimeType": "text/markdown",
"resourceUri": "lovelace://knowledge/doc_456"
}
],
"total": 1
}
lovelace_store_knowledge#
Save a new knowledge entry. Without workspaceId, saves to your default
workspace. The title is up to 500 characters and the content up to 100,000.
- Required scopes:
knowledge:writeor equivalentmcp:write/write
Input
{
"title": "API Rate Limiting Policy",
"content": "# API Rate Limiting Policy\n\n...",
"mimeType": "text/markdown",
"metadata": {
"source": "engineering-handbook"
}
}
Output
{
"documentId": "doc_456",
"title": "API Rate Limiting Policy",
"workspaceId": "ws_abc123",
"mimeType": "text/markdown",
"resourceUri": "lovelace://knowledge/doc_456",
"createdAt": "2025-02-17T12:00:00.000Z"
}
Pathway Tools#
A gateway can also list Lovelace Pathways, each as a tool named lovelace_pathway_<name> and a prompt named lovelace_pathway_prompt_<name>. They are listed only when the gateway's operator sets MCP_PATHWAYS_ENABLED=true, and then only for Pathways whose tool name fits 64 characters and that have a name and description. The public gateway at mcp.uselovelace.com does not list them.
Errors#
A tool that cannot complete returns a result with isError: true. The failure
is in structuredContent.error and, as the same JSON, in the text content:
{
"error": {
"code": "insufficient_scope",
"message": "This Lovelace connection is missing the knowledge:write permission. Reconnect Lovelace and approve it to use this tool.",
"requiredScopes": ["knowledge:write"]
}
}
Branch on code; the message is written for the model and the user.
| Code | Meaning | Extra fields |
|---|---|---|
authentication_required | No signed-in account on this connection; reconnect | |
insufficient_scope | The connection lacks a permission the tool needs | requiredScopes |
invalid_input | An argument failed validation | field |
not_found | The named workspace, agent, or entry does not exist | resource, id |
access_denied | The item exists but this account cannot use it | resource, id |
quota_exceeded | The plan limit for this action is used up | |
unavailable | A Lovelace service is not responding; retry later | retryable |
unknown_tool | No tool has the requested name | |
tool_unavailable | The tool is not offered to this connection | |
confirmation_denied | The call needed a confirmation it did not receive | reason |
internal_error | The call failed for a reason the caller cannot fix | retryable |
Quota, overload, and circuit-breaker rejections of the MCP request itself are JSON-RPC errors rather than tool results; see the gateway's error reference.
Putting it together#
Save a note and find it again, then start an agent, without looking up a workspace:
import asyncio
import json
import os
from mcp import ClientSession
from mcp.client.streamable_http import streamablehttp_client
TOKEN = os.environ["LOVELACE_TOKEN"]
def payload(result):
return json.loads(result.content[0].text)
async def main():
async with streamablehttp_client(
"https://mcp.uselovelace.com/mcp",
headers={"Authorization": f"Bearer {TOKEN}"},
) as (read, write, _):
async with ClientSession(read, write) as session:
await session.initialize()
# 1. Save and search knowledge in the default workspace
await session.call_tool(
"lovelace_store_knowledge",
{"title": "Coffee order", "content": "Oat flat white, no sugar"},
)
found = payload(
await session.call_tool(
"lovelace_search_knowledge", {"query": "coffee"}
)
)
print(found["results"][0]["snippet"])
# 2. Start an agent and poll until it finishes
agent_id = payload(
await session.call_tool(
"lovelace_spawn_agent",
{
"agentType": "general",
"task": "Summarize the key security risks in a public API",
},
)
)["agentId"]
while True:
status = payload(
await session.call_tool(
"lovelace_get_agent_status", {"agentId": agent_id}
)
)["status"]
if status != "working":
break
await asyncio.sleep(2)
print(
payload(
await session.call_tool(
"lovelace_get_agent_result", {"agentId": agent_id}
)
)
)
asyncio.run(main())
For more patterns — including knowledge-augmented agents and parallel multi-workspace orchestration — see Agent Workflows.