Oban integration for Ectomancer.
This module provides the expose_oban_jobs/0 and expose_oban_jobs/1 macros
that automatically generate MCP tools for managing Oban job queues.
Usage
defmodule MyApp.MCP do
use Ectomancer
# Expose all Oban job management tools
expose_oban_jobs
# Or with namespace prefix
expose_oban_jobs(namespace: :background)
# Generates: background_list_oban_queues, etc.
endGenerated Tools
When Oban is available in the parent application, this macro generates:
list_oban_queues- List all configured queues with job statisticsget_queue_depth- Get job count for a specific queuelist_stuck_jobs- List executing jobs (optionally filterable)retry_job- Retry a job by IDcancel_job- Cancel/delete a job by ID
Optional Dependency
Oban is an optional dependency. If Oban is not in the application's dependencies, the macro will generate no tools (silently).
Configuration
The tools query Oban.Job directly and require:
- An Ecto repo configured in the parent application
- Oban tables migrated in the database
- Oban started in the application supervision tree
Authorization
By default, Oban tools are public (no authorization). You can add authorization by wrapping the macro call or by implementing custom authorization at the MCP module level.
Summary
Functions
Exposes Oban job management tools.
Functions
Exposes Oban job management tools.
Options
:namespace- Prefix tool names with namespace (e.g.,:background→background_list_oban_queues)
Examples
expose_oban_jobs
# Generates: list_oban_queues, get_queue_depth, list_stuck_jobs, retry_job, cancel_job
expose_oban_jobs(namespace: :jobs)
# Generates: jobs_list_oban_queues, jobs_get_queue_depth, etc.