Skip to content
Lovelace

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.

ToolTitleRead onlyDestructiveIdempotentOpen world
lovelace_list_workspacesList workspacesyesnoyesno
lovelace_get_workspaceGet workspace detailsyesnoyesno
lovelace_list_agentsList agentsyesnoyesno
lovelace_spawn_agentStart a cloud agentnononoyes
lovelace_get_agent_statusGet agent statusyesnoyesno
lovelace_get_agent_resultGet agent resultyesnoyesno
lovelace_search_knowledgeSearch saved knowledgeyesnoyesno
lovelace_store_knowledgeSave knowledgenononono

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:read or equivalent mcp:read / read

Output

json
{
  "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:read or equivalent mcp:read / read

Input

json
{
  "workspaceId": "ws_abc123"
}

Output

json
{
  "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:

StatusMeaningFinal
workingThe agent has a task it has not finished, queued or runningno
succeededThe agent finished its task; lovelace_get_agent_result has the textyes
failedThe task failed or ran out of time, or the agent failedyes
stoppedThe task was cancelled, or the agent was stopped before it had a taskyes
idleThe agent has no task and has not stopped, so nothing will finishno

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:read or equivalent mcp:read / read

Input

json
{
  "workspaceId": "ws_abc123"
}

Output

json
{
  "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:write or equivalent mcp:write / write

Input

json
{
  "agentType": "general",
  "task": "Review the authentication module for security issues",
  "config": {
    "priority": "high"
  }
}

Output

json
{
  "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:read or equivalent mcp:read / read

Input

json
{
  "agentId": "agent_123"
}

workspaceId is optional and defaults to your default workspace.

Output

json
{
  "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:read or equivalent mcp:read / read

Input

json
{
  "agentId": "agent_123"
}

workspaceId is optional and defaults to your default workspace.

Output

json
{
  "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:

json
{
  "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:read or equivalent mcp:read / read

Input

json
{
  "query": "authentication best practices",
  "limit": 5
}

limit is 1 to 50 and defaults to 10.

Output

json
{
  "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:write or equivalent mcp:write / write

Input

json
{
  "title": "API Rate Limiting Policy",
  "content": "# API Rate Limiting Policy\n\n...",
  "mimeType": "text/markdown",
  "metadata": {
    "source": "engineering-handbook"
  }
}

Output

json
{
  "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:

json
{
  "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.

CodeMeaningExtra fields
authentication_requiredNo signed-in account on this connection; reconnect
insufficient_scopeThe connection lacks a permission the tool needsrequiredScopes
invalid_inputAn argument failed validationfield
not_foundThe named workspace, agent, or entry does not existresource, id
access_deniedThe item exists but this account cannot use itresource, id
quota_exceededThe plan limit for this action is used up
unavailableA Lovelace service is not responding; retry laterretryable
unknown_toolNo tool has the requested name
tool_unavailableThe tool is not offered to this connection
confirmation_deniedThe call needed a confirmation it did not receivereason
internal_errorThe call failed for a reason the caller cannot fixretryable

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:

python
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.