LangBot Docs

Workspace API

Read and manage Agents, Pipelines, bots, models, knowledge bases and more from a plugin.

The Workspace API lets a plugin work with the Workspace it is installed in: list and edit Agents and Pipelines, look up bots, manage models and knowledge bases, read monitoring data, and so on. It exposes the same operations as LangBot's HTTP API, MCP server and Workspace assistant, so a plugin can automate anything a member could do through those interfaces, within the limits the member grants.

Every operation has a stable ID, such as pipeline.list or knowledge.base.retrieve. A plugin can only call operations it declares in its manifest and a member has granted to its installation.

Calling an operation

From any component, use self.plugin.workspace. Each operation has a typed method named after its ID:

from langbot_plugin.api.definition.components.tool.tool import Tool


class WorkspaceSummary(Tool):
    async def call(self, params, session, query_id):
        result = await self.plugin.workspace.pipeline.list()
        if not result["ok"]:
            return f"Could not list pipelines: {result['error']['message']}"

        names = [pipeline["name"] for pipeline in result["result"]]
        return "Pipelines: " + ", ".join(names)

Methods take keyword arguments that match the operation's input schema, and editors show their types and documentation. A few names are adjusted to be valid Python: a segment that is a Python keyword gets a trailing underscore (for example import_), and other invalid characters become underscores. The arguments are still sent under their original names.

If you prefer to choose the operation at runtime, call it by ID. Both forms behave identically:

result = await self.plugin.workspace.call("knowledge.base.retrieve", kb_uuid=kb_uuid, query="refund policy")

await self.plugin.workspace.list() returns the operations granted to the installation, with their input schemas, grouped into domains. It is useful for building a dynamic tool list or checking a grant before offering a feature.

Inside a Runner

A Runner receives a run-bound proxy as ctx.api.workspace. It offers the same methods and is authorized by the same installation grants; the difference is that LangBot records each call against the current run.

The Agent or Pipeline that started the run may restrict which workspace operations the model should see. That selection is delivered in ctx.resources.workspace_operations. A Runner that exposes workspace operations to a model as tools should offer only those, and offer none when the list is empty. LangBot's built-in LocalAgent does exactly this.

Results and errors

Workspace calls never raise for business errors. They always return a dictionary:

# Success
{"ok": True, "result": ..., "operation": {"id": "pipeline.list", ...}}

# Failure
{"ok": False, "error": {"code": "permission_denied", "message": "...", "details": {...}}}

Check ok before reading result. Common error codes:

CodeMeaning
permission_deniedThe operation is not granted to this installation, or the installation is disabled. details.denied_operations lists the missing IDs.
invalid_inputThe arguments do not match the operation's input schema.
not_foundThe referenced resource does not exist in this Workspace.
application_errorThe operation ran and failed; message explains why.

A denied operation is an expected outcome, because members may grant only part of what a plugin declares. Handle it by explaining what is missing rather than failing the whole command or run.

Choosing operations to declare

Operations carry a risk level that the member sees when confirming:

  • Read operations only return data, such as pipeline.list or stats.basic.
  • Write operations change Workspace configuration, such as pipeline.update or knowledge.file.store.
  • High-risk operations delete resources, reach outside LangBot, or consume significant resources, such as bot.delete or pipeline.chat.broadcast. The confirmation dialog highlights them.

The member who grants an operation must hold its permission themselves (the last column below). Ask only for what your plugin needs; a request for many high-risk operations is likely to be declined or trimmed.

Wildcards such as knowledge.* request every operation under a prefix. Not every prefix can be used this way; see Wildcards.

Operation reference

This reference covers every operation a plugin can request in the current LangBot version, grouped by domain. Methods are shown on workspace, which is self.plugin.workspace in components and ctx.api.workspace in a Runner. The SDK's typed methods are generated from this catalog, so every operation listed here is available as a method.

Adapter (adapter)

OperationID and methodRiskGranting member needs
Get Adapter
Get configuration schema and requirements for an adapter.
adapter.get
workspace.adapter.get()
Readresource.view
List Adapters
List available chat platform adapters in the workspace.
adapter.list
workspace.adapter.list()
Readresource.view

Agent (agent)

OperationID and methodRiskGranting member needs
Create Agent
Create a new autonomous AI agent in the workspace.
agent.create
workspace.agent.create()
Writeresource.manage
Debug Agent
Execute a test turn on an agent for debugging purposes.
agent.debug
workspace.agent.debug()
Writeruntime.operate
Delete Agent
Delete an autonomous AI agent from the workspace.
agent.delete
workspace.agent.delete()
High riskresource.manage
Get Agent
Get full configuration and parameters for an AI agent.
agent.get
workspace.agent.get()
Readresource.view
List Agents
List all autonomous AI agents configured in the workspace.
agent.list
workspace.agent.list()
Readresource.view
Agent Metadata
Get supported agent capabilities, model types, and schemas.
agent.metadata
workspace.agent.metadata()
Readresource.view
Get Run Events
Fetch step-by-step trace events for an agent execution run.
agent.runs.events
workspace.agent.runs.events()
Readresource.view
List Agent Runs
List historical execution runs for an agent or processor.
agent.runs.list
workspace.agent.runs.list()
Readresource.view
Update Agent
Update configuration, model, or prompts of an agent.
agent.update
workspace.agent.update()
Writeresource.manage

Bot (bot)

OperationID and methodRiskGranting member needs
List Bot Admins
List platform users configured as administrators for a bot.
bot.admins.list
workspace.bot.admins.list()
Readresource.view
Create Bot
Create a new chat bot connected to an IM adapter.
bot.create
workspace.bot.create()
Writeresource.manage
Delete Bot
Delete a chat bot and remove its adapter connection.
bot.delete
workspace.bot.delete()
High riskresource.manage
Get Bot
Get detailed configuration and status for a specific bot.
bot.get
workspace.bot.get()
Readresource.view
Apply Group Filter
Apply group filtering rules to enable or disable pipelines.
bot.group_filter.apply
workspace.bot.group_filter.apply()
Writeresource.manage
Preview Group Filter
Preview chat group filtering rules for a bot.
bot.group_filter.preview
workspace.bot.group_filter.preview()
Readresource.manage
List Bots
List all configured chat bots in the workspace.
bot.list
workspace.bot.list()
Readresource.view
Bot Logs
Fetch runtime connection logs and events for a bot.
bot.logs
workspace.bot.logs()
Readresource.view
Send Bot Message
Send an outbound message to a chat user or group via a bot.
bot.message.send
workspace.bot.message.send()
High riskruntime.operate
Test Bot Message
Test bot messaging capability by sending a test message.
bot.message.test
workspace.bot.message.test()
Writeresource.manage
Preview Routes
Preview message routing decisions for a simulated event.
bot.routes.preview
workspace.bot.routes.preview()
Readresource.manage
Routing Status
Get active message routing bindings and rules for a bot.
bot.routes.status
workspace.bot.routes.status()
Readresource.view
Bot Runtime Status
Inspect live connection state and health of a bot.
bot.runtime.get
workspace.bot.runtime.get()
Readresource.view
Update Bot
Update settings or pipeline bindings for an existing bot.
bot.update
workspace.bot.update()
Writeresource.manage

Extension (extension)

OperationID and methodRiskGranting member needs
List All Extensions
List all available plugins, MCP servers, and skills combined.
extension.list
workspace.extension.list()
Readresource.view

Knowledge Base (knowledge)

OperationID and methodRiskGranting member needs
Create Knowledge Base
Create a new knowledge base with storage and vector engine.
knowledge.base.create
workspace.knowledge.base.create()
Writeresource.manage
Delete Knowledge Base
Permanently delete a knowledge base and indexed documents.
knowledge.base.delete
workspace.knowledge.base.delete()
High riskresource.manage
Get Knowledge Base
Get configuration and indexing status of a knowledge base.
knowledge.base.get
workspace.knowledge.base.get()
Readresource.view
List Knowledge Bases
List all knowledge bases configured in the workspace.
knowledge.base.list
workspace.knowledge.base.list()
Readresource.view
Retrieve Knowledge Chunks
Search and retrieve relevant text chunks from knowledge base.
knowledge.base.retrieve
workspace.knowledge.base.retrieve()
Readresource.view
Update Knowledge Base
Update configuration or description of a knowledge base.
knowledge.base.update
workspace.knowledge.base.update()
Writeresource.manage
Engine Creation Schema
Get configuration schema required to create an engine.
knowledge.engine.creation_schema
workspace.knowledge.engine.creation_schema()
Readresource.view
List Knowledge Engines
List available storage and vector retrieval engine types.
knowledge.engine.list
workspace.knowledge.engine.list()
Readresource.view
Engine Retrieval Schema
Get parameter schema for retrieving from an engine.
knowledge.engine.retrieval_schema
workspace.knowledge.engine.retrieval_schema()
Readresource.view
Delete Knowledge File
Delete an indexed document from a knowledge base.
knowledge.file.delete
workspace.knowledge.file.delete()
High riskresource.manage
List Knowledge Files
List all documents indexed within a knowledge base.
knowledge.file.list
workspace.knowledge.file.list()
Readresource.view
Store Knowledge File
Index and store a document into a knowledge base.
knowledge.file.store
workspace.knowledge.file.store()
Writeresource.manage
List Document Parsers
List supported document parser formats and capabilities.
knowledge.parser.list
workspace.knowledge.parser.list()
Readresource.view

MCP (mcp)

OperationID and methodRiskGranting member needs
List MCP Resources
List all resources exposed by connected MCP servers.
mcp.resource.list
workspace.mcp.resource.list()
Readresource.view
Read MCP Resource
Read contents of a specific resource from an MCP server.
mcp.resource.read
workspace.mcp.resource.read()
Readresource.view
List MCP Resource Templates
List parameterized resource URI templates from MCP servers.
mcp.resource.templates
workspace.mcp.resource.templates()
Readresource.view
Delete MCP Server
Disconnect and delete an MCP server from the workspace.
mcp.server.delete
workspace.mcp.server.delete()
High riskresource.manage
Get MCP Server
Get configuration and parameters of a specific MCP server.
mcp.server.get
workspace.mcp.server.get()
Readresource.view
List MCP Servers
List configured Model Context Protocol (MCP) servers.
mcp.server.list
workspace.mcp.server.list()
Readresource.view
MCP Server Logs
Retrieve communication and error logs for an MCP server.
mcp.server.logs
workspace.mcp.server.logs()
Readaudit.view
MCP Server Runtime
Inspect live health and session state of an MCP server.
mcp.server.runtime
workspace.mcp.server.runtime()
Readresource.view
Test MCP Server Connection
Test connectivity and ping an MCP server configuration.
mcp.server.test
workspace.mcp.server.test()
Writeresource.manage

Model (model)

OperationID and methodRiskGranting member needs
Create Embedding Model
Configure and add a new embedding model to the workspace.
model.embedding.create
workspace.model.embedding.create()
Writeprovider_secret.manage
Delete Embedding Model
Delete an embedding model configuration from the workspace.
model.embedding.delete
workspace.model.embedding.delete()
High riskresource.manage
Get Embedding Model
Get configuration and parameters of an embedding model.
model.embedding.get
workspace.model.embedding.get()
Readresource.view
List Embedding Models
List all text embedding models configured in the workspace.
model.embedding.list
workspace.model.embedding.list()
Readresource.view
List Embeddings by Provider
List embedding models configured under a specific provider.
model.embedding.list_by_provider
workspace.model.embedding.list_by_provider()
Readresource.view
Test Embedding Model
Test vector generation and connectivity for embedding model.
model.embedding.test
workspace.model.embedding.test()
Writeprovider_secret.manage
Update Embedding Model
Update configuration and parameters of an embedding model.
model.embedding.update
workspace.model.embedding.update()
Writeprovider_secret.manage
Create LLM Model
Configure and add a new LLM model to the workspace.
model.llm.create
workspace.model.llm.create()
Writeprovider_secret.manage
Get Default LLM Model
Get workspace default large language model configuration.
model.llm.default.get
workspace.model.llm.default.get()
Readresource.manage
Delete LLM Model
Delete an LLM model configuration from the workspace.
model.llm.delete
workspace.model.llm.delete()
High riskresource.manage
Get LLM Model
Get configuration and parameters of a specific LLM model.
model.llm.get
workspace.model.llm.get()
Readresource.view
List LLM Models
List all configured large language models in the workspace.
model.llm.list
workspace.model.llm.list()
Readresource.view
List LLMs by Provider
List LLM models configured under a specific model provider.
model.llm.list_by_provider
workspace.model.llm.list_by_provider()
Readresource.view
Get Starred LLM Model
Get the starred favorite LLM model of the workspace.
model.llm.starred.get
workspace.model.llm.starred.get()
Readresource.view
Set Starred LLM Model
Designate a specific LLM model as the starred favorite.
model.llm.starred.set
workspace.model.llm.starred.set()
Writeprovider_secret.manage
Test LLM Model
Test connectivity and response generation for an LLM model.
model.llm.test
workspace.model.llm.test()
Writeprovider_secret.manage
Update LLM Model
Update configuration and parameters of an LLM model.
model.llm.update
workspace.model.llm.update()
Writeprovider_secret.manage
Create Rerank Model
Configure and add a new rerank model to the workspace.
model.rerank.create
workspace.model.rerank.create()
Writeprovider_secret.manage
Delete Rerank Model
Delete a rerank model configuration from the workspace.
model.rerank.delete
workspace.model.rerank.delete()
High riskresource.manage
Get Rerank Model
Get configuration and parameters of a rerank model.
model.rerank.get
workspace.model.rerank.get()
Readresource.view
List Rerank Models
List all document reranking models in the workspace.
model.rerank.list
workspace.model.rerank.list()
Readresource.view
List Reranks by Provider
List rerank models configured under a specific provider.
model.rerank.list_by_provider
workspace.model.rerank.list_by_provider()
Readresource.view
Test Rerank Model
Test connectivity and scoring capability of a rerank model.
model.rerank.test
workspace.model.rerank.test()
Writeprovider_secret.manage
Update Rerank Model
Update configuration and parameters of a rerank model.
model.rerank.update
workspace.model.rerank.update()
Writeprovider_secret.manage

Monitoring (monitoring)

OperationID and methodRiskGranting member needs
Embedding Call Metrics
Query embedding generation metrics and latency statistics.
monitoring.embedding_calls
workspace.monitoring.embedding_calls()
Readresource.view
Error Logs
Query runtime errors and failures across bots and pipelines.
monitoring.errors
workspace.monitoring.errors()
Readresource.view
Execution Details
Get detailed traces and step execution events for a specific execution.
monitoring.execution.detail
workspace.monitoring.execution.detail()
Readresource.view
List Executions
Query execution history records across bots, pipelines, and agents.
monitoring.executions
workspace.monitoring.executions()
Readresource.view
List User Feedback
List user ratings and feedback records on bot responses.
monitoring.feedback.list
workspace.monitoring.feedback.list()
Readresource.view
Feedback Statistics
Get aggregated positive and negative user feedback metrics.
monitoring.feedback.stats
workspace.monitoring.feedback.stats()
Readresource.view
In-Flight Executions
Inspect currently active in-flight requests and pipeline runs.
monitoring.inflight
workspace.monitoring.inflight()
Readresource.view
LLM Call Metrics
Query model invocation counts, latencies, and token stats.
monitoring.llm_calls
workspace.monitoring.llm_calls()
Readresource.view
Message Details
Retrieve full metadata and trace details for a single message.
monitoring.message.detail
workspace.monitoring.message.detail()
Readresource.view
Query Messages
Query processed chat messages across bot sessions.
monitoring.messages
workspace.monitoring.messages()
Readresource.view
Monitoring Overview
Get aggregated monitoring overview statistics for bots and pipelines.
monitoring.overview
workspace.monitoring.overview()
Readresource.view
Session Analysis
Analyze session metrics, duration, and token usage for a session.
monitoring.session.analysis
workspace.monitoring.session.analysis()
Readresource.view
Reset Session
Reset a chat session and clear its context window.
monitoring.session.reset
workspace.monitoring.session.reset()
High riskresource.manage
List Sessions
List active and historical chat sessions across bots.
monitoring.sessions
workspace.monitoring.sessions()
Readresource.view
Token Usage Statistics
Query token consumption metrics aggregated by time buckets.
monitoring.tokens
workspace.monitoring.tokens()
Readresource.view
Tool Call Metrics
Query tool invocation history and execution performance.
monitoring.tool_calls
workspace.monitoring.tool_calls()
Readresource.view

Pipeline (pipeline)

OperationID and methodRiskGranting member needs
Broadcast Chat Message
Broadcast a message to all active pipeline chat clients.
pipeline.chat.broadcast
workspace.pipeline.chat.broadcast()
High riskruntime.operate
Pipeline Connections
Inspect live websocket connection status for pipeline chat.
pipeline.chat.connections
workspace.pipeline.chat.connections()
Readruntime.operate
Pipeline Chat History
Retrieve debug chat message history for a pipeline session.
pipeline.chat.history
workspace.pipeline.chat.history()
Readruntime.operate
Reset Chat Session
Clear memory and chat history for a pipeline debug session.
pipeline.chat.reset
workspace.pipeline.chat.reset()
High riskruntime.operate
Copy Pipeline
Duplicate an existing pipeline to create a new copy.
pipeline.copy
workspace.pipeline.copy()
Writeresource.manage
Create Pipeline
Create a new processing pipeline in the workspace.
pipeline.create
workspace.pipeline.create()
Writeresource.manage
Pipeline Defaults
Get template defaults and initial values for new pipelines.
pipeline.defaults
workspace.pipeline.defaults()
Readresource.view
Delete Pipeline
Permanently delete a pipeline from the workspace.
pipeline.delete
workspace.pipeline.delete()
High riskresource.manage
Get Pipeline Extensions
Get bound plugins, MCP servers, and tools for a pipeline.
pipeline.extensions.get
workspace.pipeline.extensions.get()
Readresource.view
Update Pipeline Extensions
Update bound plugins, MCP servers, and tools on a pipeline.
pipeline.extensions.update
workspace.pipeline.extensions.update()
Writeresource.manage
Get Pipeline
Get complete definition and node graph of a pipeline.
pipeline.get
workspace.pipeline.get()
Readresource.view
List Pipelines
List all message processing pipelines in the workspace.
pipeline.list
workspace.pipeline.list()
Readresource.view
Pipeline Metadata
Get available component types and node specifications.
pipeline.metadata
workspace.pipeline.metadata()
Readresource.view
Run Pipeline
Execute a pipeline run with custom input data.
pipeline.run
workspace.pipeline.run()
Writeruntime.operate
Update Pipeline
Update topology, nodes, or settings of a pipeline.
pipeline.update
workspace.pipeline.update()
Writeresource.manage

Plugin (plugin)

OperationID and methodRiskGranting member needs
Get Plugin Config
Get configured parameters and settings for a plugin.
plugin.config.get
workspace.plugin.config.get()
Readresource.view
Plugin Debug Info
Inspect internal plugin runtime process state and memory.
plugin.debug_info
workspace.plugin.debug_info()
Readresource.manage
Get Plugin
Get detailed metadata and manifest for an installed plugin.
plugin.get
workspace.plugin.get()
Readresource.view
Plugin GitHub Assets
List downloadable asset files for a GitHub release.
plugin.github.assets
workspace.plugin.github.assets()
Readresource.view
Plugin GitHub Releases
List releases of a plugin repository hosted on GitHub.
plugin.github.releases
workspace.plugin.github.releases()
Readresource.view
List Plugins
List all installed plugins and their running status.
plugin.list
workspace.plugin.list()
Readresource.view
Plugin Logs
Fetch runtime logs and error messages from a plugin.
plugin.logs
workspace.plugin.logs()
Readaudit.view
Plugin Readme
Get documentation and usage instructions for a plugin.
plugin.readme
workspace.plugin.readme()
Readresource.view

Model Provider (provider)

OperationID and methodRiskGranting member needs
Create Provider
Add a new model provider and credentials to the workspace.
provider.create
workspace.provider.create()
Writeprovider_secret.manage
Delete Provider
Delete a model provider and its associated models.
provider.delete
workspace.provider.delete()
High riskresource.manage
Get Provider
Get configuration and credentials of a model provider.
provider.get
workspace.provider.get()
Readresource.view
List Providers
List all configured model providers in the workspace.
provider.list
workspace.provider.list()
Readresource.view
Provider Models Count
Count models configured under a specific model provider.
provider.models.count
workspace.provider.models.count()
Readresource.view
Scan Provider Models
Scan remote provider endpoint for available models.
provider.models.scan
workspace.provider.models.scan()
Writeprovider_secret.manage
Update Provider
Update credentials or base URL of a model provider.
provider.update
workspace.provider.update()
Writeprovider_secret.manage

Requester (requester)

OperationID and methodRiskGranting member needs
Get Requester
Get configuration and capabilities of an HTTP requester.
requester.get
workspace.requester.get()
Readresource.view
List Requesters
List HTTP request client adapters used for model calls.
requester.list
workspace.requester.list()
Readresource.view

Skill (skill)

OperationID and methodRiskGranting member needs
Create Skill
Create and register a new custom skill package.
skill.create
workspace.skill.create()
Writeresource.manage
Delete Skill
Delete a custom skill and remove its code files.
skill.delete
workspace.skill.delete()
High riskresource.manage
List Skill Files
List files and directories within a skill package.
skill.file.list
workspace.skill.file.list()
Readresource.view
Read Skill File
Read the source code or content of a file in a skill.
skill.file.read
workspace.skill.file.read()
Readresource.view
Write Skill File
Write or update a code file inside a skill package.
skill.file.write
workspace.skill.file.write()
Writeresource.manage
Get Skill
Get full manifest and metadata for a specific skill.
skill.get
workspace.skill.get()
Readresource.view
Preview GitHub Skill
Preview a skill package from a GitHub repository.
skill.github.preview
workspace.skill.github.preview()
Readresource.manage
List Skills
List all custom skills installed in the workspace.
skill.list
workspace.skill.list()
Readresource.view
Reload Skills
Reload all skill packages and refresh runtime registries.
skill.reload
workspace.skill.reload()
Writeresource.manage
Update Skill
Update metadata or configuration of an existing skill.
skill.update
workspace.skill.update()
Writeresource.manage

Statistics (stats)

OperationID and methodRiskGranting member needs
Basic Statistics
Get workspace overview counters for bots, models, and pipelines.
stats.basic
workspace.stats.basic()
Readresource.view

Tool (tool)

OperationID and methodRiskGranting member needs
Get Tool
Get parameter schema and description for a specific tool.
tool.get
workspace.tool.get()
Readresource.view
List Tools
List all registered function tools available for execution.
tool.list
workspace.tool.list()
Readresource.view

On this page