Skip to main content
ClaudeWave
Slash Command389 estrellas del repoactualizado 3d ago

add-tool

The add-tool command automates the creation of a new MCP tool in the Astronomer Airflow MCP server by generating an implementation function that calls an adapter method, decorating it with the MCP tool wrapper, and adding appropriate documentation. Use this when extending the server's capabilities with new tools that interact with Airflow adapters.

Instalar en Claude Code
Copiar
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/astronomer/agents/HEAD/astro-airflow-mcp/.claude/commands/add-tool.md -o ~/.claude/commands/add-tool.md
Después abre una sesión nueva de Claude Code; el slash command carga automáticamente.

add-tool.md

Add a new MCP tool named `$ARGUMENTS` to `src/astro_airflow_mcp/server.py`.

## Steps

1. If the tool needs a new adapter method, run `/add-adapter-method` first.

2. Create internal `_impl` function that calls the adapter:

```python
def _tool_name_impl(param: str) -> str:
    """Internal implementation."""
    try:
        adapter = _get_adapter()
        data = adapter.method_name(param)
        return json.dumps(data, indent=2)
    except Exception as e:
        return str(e)
```

3. Create the MCP tool with descriptive docstring:

```python
@mcp.tool()
def tool_name(param: str) -> str:
    """One-line description.

    Use this tool when the user asks about:
    - "Example query 1"
    - "Example query 2"

    Args:
        param: Description

    Returns:
        JSON with response data
    """
    return _tool_name_impl(param=param)
```

4. Add the tool to README.md tools table.
add-adapter-methodSlash Command

Add a new method to both Airflow adapters

check-airflow-compatSlash Command

Verify code works with both Airflow 2.x and 3.x

airflow-adapterSkill

Airflow adapter pattern for v2/v3 API compatibility. Use when working with adapters, version detection, or adding new API methods that need to work across Airflow 2.x and 3.x.

airflow-hitlSkill

Use when the user needs human-in-the-loop workflows in Airflow (approval/reject, form input, or human-driven branching). Covers ApprovalOperator, HITLOperator, HITLBranchOperator, HITLEntryOperator, HITLTrigger. Requires Airflow 3.1+. Does not cover AI/LLM calls (see airflow-ai).

airflow-pluginsSkill

Build Airflow 3.1+ plugins that embed FastAPI apps, custom UI pages, React components, middleware, macros, and operator links directly into the Airflow UI. Use this skill whenever the user wants to create an Airflow plugin, add a custom UI page or nav entry to Airflow, build FastAPI-backed endpoints inside Airflow, serve static assets from a plugin, embed a React app in the Airflow UI, add middleware to the Airflow API server, create custom operator extra links, or call the Airflow REST API from inside a plugin. Also trigger when the user mentions AirflowPlugin, fastapi_apps, external_views, react_apps, plugin registration, or embedding a web app in Airflow 3.1+. If someone is building anything custom inside Airflow 3.1+ that involves Python and a browser-facing interface, this skill almost certainly applies.

airflowSkill

Queries, manages, and troubleshoots Apache Airflow using the af CLI. Covers listing DAGs, triggering runs, reading task logs, diagnosing failures, debugging DAG import errors, checking connections, variables, pools, and monitoring health. Also routes to sub-skills for writing DAGs, debugging, deploying, and migrating Airflow 2 to 3. Use when user mentions "Airflow", "DAG", "DAG run", "task log", "import error", "parse error", "broken DAG", or asks to "trigger a pipeline", "debug import errors", "check Airflow health", "list connections", "retry a run", or any Airflow operation. Do NOT use for warehouse/SQL analytics on Airflow metadata tables — use analyzing-data instead.

analyzing-dataSkill

Queries data warehouse and answers business questions about data. Handles questions requiring database/warehouse queries including "who uses X", "how many Y", "show me Z", "find customers", "what is the count", data lookups, metrics, trends, or SQL analysis.

annotating-task-lineageSkill

Annotate Airflow tasks with data lineage using inlets and outlets. Use when the user wants to add lineage metadata to tasks, specify input/output datasets, or enable lineage tracking for operators without built-in OpenLineage extraction.