Skip to main content
Glama

Add Activity to Pipeline from JSON

add_activity_to_pipeline

Add custom activities to Microsoft Fabric pipelines using JSON templates for Notebook, Script, Web, or other activity types.

Instructions

Add a generic activity to an existing Fabric pipeline from a JSON template.

Retrieves an existing pipeline, adds an activity from the provided JSON template, and updates the pipeline definition. This is a more general-purpose tool compared to add_copy_activity_to_pipeline, allowing you to add any type of Fabric pipeline activity by providing its complete JSON definition.

Use this tool when:

  • You have a custom activity JSON template to add

  • You want to add activity types beyond Copy (e.g., Notebook, Script, Web, etc.)

  • You need full control over the activity definition

  • You're working with complex activity configurations

Activity JSON Requirements:

  • Must be a valid dictionary/object

  • Must include a "name" field (string)

  • Must include a "type" field (e.g., "Copy", "Notebook", "Script", "Web", etc.)

  • Should include all required properties for the specific activity type

  • Common fields: "dependsOn", "policy", "typeProperties"

Parameters: workspace_name: The display name of the workspace containing the pipeline. pipeline_name: Name of the existing pipeline to update. activity_json: Complete JSON dictionary representing the activity definition. Must include "name", "type", and all required properties.

Returns: Dictionary with status, pipeline_id, pipeline_name, activity_name, activity_type, workspace_name, and message.

Example: ```python # Example 1: Add a Copy Activity from JSON template copy_activity = { "name": "CopyCustomData", "type": "Copy", "dependsOn": [], "policy": { "timeout": "0.12:00:00", "retry": 0, "retryIntervalInSeconds": 30, "secureOutput": False, "secureInput": False }, "typeProperties": { "source": { "type": "AzurePostgreSqlSource", "partitionOption": "None", "queryTimeout": "02:00:00", "datasetSettings": { "type": "AzurePostgreSqlTable", "schema": [], "typeProperties": { "schema": "public", "table": "products" }, "externalReferences": { "connection": "12345678-1234-1234-1234-123456789abc" } } }, "sink": { "type": "LakehouseTableSink", "tableActionOption": "Overwrite", "applyVOrder": True, "datasetSettings": { "type": "LakehouseTable", "typeProperties": { "table": "products" } } } } }

result = add_activity_to_pipeline(
    workspace_name="Analytics Workspace",
    pipeline_name="My_Pipeline",
    activity_json=copy_activity
)

# Example 2: Add a Notebook Activity
notebook_activity = {
    "name": "RunTransformation",
    "type": "Notebook",
    "dependsOn": [
        {
            "activity": "CopyCustomData",
            "dependencyConditions": ["Succeeded"]
        }
    ],
    "policy": {
        "timeout": "1.00:00:00",
        "retry": 0
    },
    "typeProperties": {
        "notebookPath": "/Notebooks/TransformData",
        "parameters": {
            "table_name": "products"
        }
    }
}

result = add_activity_to_pipeline(
    workspace_name="Analytics Workspace",
    pipeline_name="My_Pipeline",
    activity_json=notebook_activity
)
```

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspace_nameYes
pipeline_nameYes
activity_jsonYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden and does well by explaining the tool's behavior: it 'retrieves an existing pipeline, adds an activity... and updates the pipeline definition.' It also details the JSON requirements and return structure. However, it lacks information on error handling, permissions needed, or idempotency, leaving some behavioral aspects unclear.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (purpose, usage guidelines, requirements, parameters, returns, examples) and front-loads key information. However, the lengthy code examples (while helpful) make it somewhat verbose, and some sentences could be tightened (e.g., 'This is a more general-purpose tool...' is slightly redundant).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (mutation operation, JSON-heavy input, sibling alternatives) and lack of annotations, the description provides comprehensive context: purpose, usage guidelines, parameter details, return values, and extensive examples. The output schema exists, so return values need not be explained in depth, and the description covers all critical aspects for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate fully. It provides detailed semantics for all three parameters: 'workspace_name' and 'pipeline_name' are clearly explained, and 'activity_json' gets extensive documentation including required fields, examples, and validation rules. This adds significant value beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Add'), resource ('generic activity'), and target ('existing Fabric pipeline') with specific differentiation from sibling tools. It explicitly contrasts with 'add_copy_activity_to_pipeline' as a 'more general-purpose tool' for 'any type of Fabric pipeline activity,' making the purpose distinct and unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description includes a dedicated 'Use this tool when:' section with four explicit scenarios, including when to use alternatives ('beyond Copy'), prerequisites ('custom activity JSON template'), and context ('full control over activity definition,' 'complex activity configurations'). This provides clear, actionable guidance for tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bablulawrence/ms-fabric-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server