connector-tool

connector-tool is a skill for Claude Code from ag2ai/ag2-claude-plugins. It costs 32 tokens per session (1,098 once invoked), scanned A, original, Apache-2.0.

A recipe for building functions that let an AG2 agent communicate with outside services such as Slack, GitHub, Microsoft Graph, or databases. It covers authentication, paging through results, and API rate limits.

In plain words
What is it for?
Use it to create tools that list, read, create, update, or delete data in a chosen service using an API key, OAuth token, or service account.
Why use it?
It removes repeated setup work and gives external API calls a consistent way to handle credentials, errors, and large result sets.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the ag2-tool-builder plugin — 2 skills shipped together

Good fit Use it to create tools that list, read, create, update, or delete data in a chosen service using an API key, OAuth token, or service account.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ag2ai/ag2-claude-plugins/connector-tool
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ag2ai/ag2-claude-plugins --skill connector-tool
Clone the repo
git clone --depth 1 https://github.com/ag2ai/ag2-claude-plugins

Made for: Claude Code.

Or install ag2-tool-builder, the plugin that ships this one along with the rest of its 2 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for connector-tool

README.md
[![agentmods](https://agentmods.dev/badge/skills/ag2ai/ag2-claude-plugins/connector-tool/github.svg)](https://agentmods.dev/skills/ag2ai/ag2-claude-plugins/connector-tool)
Your own site
<a href="https://agentmods.dev/skills/ag2ai/ag2-claude-plugins/connector-tool"><img src="https://agentmods.dev/badge/skills/ag2ai/ag2-claude-plugins/connector-tool/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for connector-tool

Your own site · 80×15
<a href="https://agentmods.dev/skills/ag2ai/ag2-claude-plugins/connector-tool"><img src="https://agentmods.dev/badge/skills/ag2ai/ag2-claude-plugins/connector-tool.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,098 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00032 $0.01098
Opus 5.5 $0.00013 $0.00439
Sonnet 5.5 $0.00006 $0.00220
Haiku 4.5 $0.00003 $0.00110

Measured 3mo ago against content hash 2e74525c266b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

connector-tool scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/ag2-tool-builder/skills/connector-tool/SKILL.md · 138 lines

How it starts

The opening of the file, as written. The whole thing — 138 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are creating connector-integrated tool functions for AG2 agents that call external APIs.

Instructions

  1. Ask the user for:

    • Which service/API to integrate with
    • What operations are needed (list, get, create, update, delete)
    • Authentication method (API key, OAuth token, service account)
    • Rate limiting concerns
  2. Generate connector tools following this pattern:

Connector Tool Pattern

import json
import os
import httpx
from autogen.tools import tool

# --- Configuration ---

BASE_URL = "https://api.service.com/v1"


def _get_headers() -> dict:
    """Build auth headers from environment."""
    token = os.environ.get("SERVICE_API_TOKEN")
    if not token:
        raise ValueError("connector_setup_required:service_name")
    return {
        "Authorization": f"Bearer {token}",
        "Content-Type": "application/json",
    }


def _make_request(method: str, path: str, **kwargs) -> dict:
    """Centralized HTTP request handler with error mapping."""
    try:
        headers = _get_headers()
    except ValueError as e:
        return {"success": False, "error": str(e)}

    url = f"{BASE_URL}/{path.lstrip('/')}"
    try:
        response = httpx.request(method, url, headers=headers, timeout=30.0, **kwargs)
        response.raise_for_status()
        return {"success": True, "data": response.json()}
    except httpx.HTTPStatusError as e:
        status = e.response.status_code
        if status == 401:
            return {"success": False, "error": "connector_setup_required:service_name"}
        elif status == 403:
            return {"success": False, "error": f"Permission denied: {e.response.text}"}
        elif status == 404:
            return {"success": False, "error": f"Resource not found: {path}"}
        elif status == 429:
            return {"success": False, "error": "Rate limit exceeded. Try again in a few seconds."}
        else:
            return {"success": False, "error": f"API error {status}: {e.response.text}"}
    except httpx.RequestError as e:
        return {"success": False, "error": f"Connection error: {e}"}


# --- Tool Functions ---

@tool()
def list_items(limit: int = 20, offset: int = 0, filter_query: str = "") -> str:
    """List items from the service with optional filtering.

    Args:
        limit: Maximum items to return (default: 20, max: 100)
        offset: Pagination offset (default: 0)
        filter_query: Optional search/filter string
    """
    params = {"limit": min(limit, 100), "offset": offset}
    if filter_query:
        params["q"] = filter_query
    result = _make_request("GET", "/items", params=params)
    return json.dumps(result)


@tool()
def get_item(item_id: str) -> str:
    """Get detailed information about a specific item.

    Args:
        item_id: The unique identifier of the item
    """
    if not item_id.strip():
        return json.dumps({"success": False, "error": "item_id is required"})
    result = _make_request("GET", f"/items/{item_id}")
    return json.dumps(result)


@tool()
def create_item(name: str, description: str = "", metadata_json: str = "{}") -> str:
    """Create a new item in the service.

    Args:
        name: Name for the new item (required)
        description: Optional description
        metadata_json: Optional JSON string with additional fields
    """
    try:
        metadata = json.loads(metadata_json) if metadata_json else {}
    except json.JSONDecodeError:
        return json.dumps({"success": False, "error": "metadata_json must be valid JSON"})

    payload = {"name": name, "description": description, **metadata}
    result = _make_request("POST", "/items", json=payload)
    return json.dumps(result)

Read the full file on GitHub · 138 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 138 lines · 32 tokens per session scan A 2e74525c266b

Subscribe to this mod's changes

connector-tool is a skill published in the GitHub repository ag2ai/ag2-claude-plugins (6 stars, last pushed 7mo ago), licensed Apache-2.0. It adds 32 tokens to every session and 1,098 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

connector-tool compared with skills from other repositories

connector-tool next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
connector-toolag2ai/ag2-claude-pluginsSkill67mo agoApache-2.0A32Claude Code
mem0-oss-to-platformmem0ai/mem0Skill70ktodayApache-2.0A217Claude Code, Codex
tao-run-inference-serviceNVIDIA/skillsSkill4.3ktodayApache-2.0A92Claude Code
azure-mgmt-botservice-dotnetmicrosoft/skillsSkill3.3ktodayMITA78Claude Code
fastapi-router-pymicrosoft/skillsSkill3.3ktodayMITA46Claude Code
dev-runtimelangwatch/langwatchSkill5.1ktodayApache-2.0A172Claude Code
api-designericrisco/rsc-harnessSkill7072d agoMITA105Claude Code, Codex