Skip to content

MCP Tools Reference

marko/mcp exposes tools to AI agents via the Model Context Protocol. Thirteen tools are always registered when the MCP server starts. Two additional tools are registered conditionally depending on which packages are installed.

These ten tools read from the IndexCache. The cache is loaded lazily on first access and rebuilt automatically if stale.

ToolDescription
check_config_keyCheck whether a given dot-notation config key exists in the project index
find_event_observersReturn all observers registered for a given event class
find_plugins_targetingReturn all plugins targeting a given class
get_config_schemaReturn the schema definition for a config namespace
list_commandsList all console commands registered across installed modules
list_modulesList all installed Marko modules with their paths and metadata
list_routesList all routes registered across installed modules
resolve_preferenceReturn the concrete class bound to a given interface
resolve_templateReturn the resolved file path for a given template name
validate_moduleCheck a module for structural errors (missing bindings, malformed attributes, etc.)

These three tools are always registered and do not depend on the index.

ToolDescription
app_infoReturn the application name and the versions of all installed Marko packages (reads composer.json and vendor/composer/installed.json)
read_log_entriesRead recent entries from the application log files in storage/logs/, filterable by level and limit. To fetch the most recent error, call read_log_entries(level: 'error', limit: 1)
run_console_commandRun a Marko console command and return its output as a string

Registered when marko/database is bound in the container. Allows agents to run read-only SQL queries against the application database and receive results as structured data.

If marko/database is not installed, this tool does not appear in the MCP tool list.

Registered when a DocsSearchInterface binding is present in the container. That binding comes from a docs search driver — marko/docs-fts (SQLite FTS5 full-text search), or any other package that binds DocsSearchInterface.

Install and build it so search_docs is wired up:

Terminal window
composer require --dev marko/docs-fts
marko docs-fts:build

marko devai:install builds the index for you when a driver is installed. If no docs driver is installed, search_docs does not appear in the MCP tool list — the install still completes and logs how to add one.

There is no dedicated “last error” tool. Agents fetch the most recent error through the log reader: read_log_entries(level: 'error', limit: 1). This works against any log driver that implements LogReaderInterface (the default FileLogReader parses storage/logs/), so it keeps working when the log backend changes.