Przejdź do treści
Biblioteka skilli
AI i agenci · Budowanie i kod

agent-tool

/agent-tool

Dodaje do agenta AI nową funkcję, którą model może wywołać, na przykład zapytanie do zewnętrznego API.

Licencja
MIT
Ostatnia zmiana repozytorium
06.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 06.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Dodaje do agenta AI nową funkcję, którą model może wywołać, na przykład zapytanie do zewnętrznego API.

Oryginalny opis (EN)

Add a new tool/function the AI agent can call (e.g. look something up, hit an external API, perform an action). Use when extending the assistant's capabilities, wiring a new function into the agent, or when the model needs a new action. This project uses {{ cookiecutter.ai_framework }}.

Jak działa

  1. Steps
  2. Rules
Sekcje z nagłówków SKILL.md, w oryginale · 46 linii, 383 słów
Podgląd SKILL.md
---
name: agent-tool
description: Add a new tool/function the AI agent can call (e.g. look something up, hit an external API, perform an action). Use when extending the assistant's capabilities, wiring a new function into the agent, or when the model needs a new action. This project uses {{ cookiecutter.ai_framework }}.
---

# Add an Agent Tool ({{ cookiecutter.ai_framework }})

Agent tools live in `backend/app/agents/tools/` and are surfaced to the model so it can call them mid-conversation. The assistant is defined in `backend/app/agents/`.

## Steps

1. **Write the tool function** in `backend/app/agents/tools/<tool_name>.py`:
   - Async, fully type-hinted, with a clear docstring — **the docstring and signature are what the model sees**, so make them precise.
   - Pure logic: take typed args, return a JSON-serializable result. Raise on hard errors; return a structured `{"error": ...}` for soft failures the model should reason about.
   - Keep secrets/IO behind `settings` and the service layer; don't inline credentials.

2. **Export it** from `backend/app/agents/tools/__init__.py` (add the import and append to `__all__`, matching the existing feature-gated blocks).

3. **Register it on the agent** in the assistant for the active framework:
{%- if cookiecutter.use_pydantic_ai %}
   - `app/agents/assistant.py` — decorate with `@agent.tool` (needs `RunContext[Deps]`) or `@agent.tool_plain` (no context):
     ```python
     @agent.tool
     async def my_tool(ctx: RunContext[Deps], query: str) -> dict:
         """One-line description the model reads to decide when to call this."""
         ...
     ```
{%- elif cookiecutter.use_pydantic_deep %}
   - `app/agents/pydantic_deep_assistant.py` — add the function to the agent's tool list.
{%- elif cookiecutter.use_langchain %}
   - `app/agents/langchain_assistant.py` — wrap with `@tool` and add it to the `tools=[...]` passed to the agent.
{%- elif cookiecutter.use_langgraph %}
   - `app/agents/langgraph_assistant.py` — wrap with `@tool` and include it in the tools list bound to the graph.
{%- elif cookiecutter.use_deepagents %}
   - `app/agents/deepagents_assistant.py` — add the function to the agent's tool list.
{%- endif %}

4. **Prompt guidance (optional but recommended):** if the tool should only be used in specific situations, add a sentence to the system prompt in `app/agents/prompts.py` so the model knows *when* to reach for it.

5. **Frontend rendering (optional):** tool calls render as cards in the chat UI. For a bespoke card, add a renderer under `frontend/src/components/chat/tool-results/`; otherwise the generic card handles it.

6. **Test it:** add `backend/tests/test_<tool_name>.py` (see existing `test_web_search.py` / `test_chart_tool.py`). Tools are plain async functions — test them directly, no agent needed.

## Rules

- The docstring is the contract with the model — keep it accurate and action-oriented.
- Return small, structured payloads; don't dump huge blobs into the context.
- Long-running or side-effecting work belongs in a service (and possibly a background task), not inline in the tool.
- See `docs/howto/add-agent-tool.md` for a fuller walkthrough.

Wersje

RepozytoriumWynikLicencja
Ta strona · AnkonKumarSingh/InnovateIT-Agent-OS-AI-Agent-Platform100MIT
fsemilia/order-hub90MIT

Migawka bazy z 13.11.2026 · wersja paczki 12f40cba74f6 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 95add-tool
    Tworzy szkielet nowej definicji narzędzia MCP dla serwera, gdy trzeba dodać nową funkcję.
  • 100foundry-tool-design
    Projektuje narzędzia, które agent Foundry może wywołać: nazwy, schematy wejścia i wyjścia, skutki uboczne, potwierdzenia i limity.
  • 90agent-tools-dsh
    Szuka zewnętrznego API, serwera MCP lub agenta do zadania, porównuje je pod kątem stanu i jakości oraz sprawdza bezpieczeństwo MCP.
  • 100anth-core-workflow-a
    Buduje przepływy tool use (wywoływanie funkcji) z Messages API, w tym pętle agentów i asystentów korzystających z zewnętrznych systemów.
  • 100agent-toolkit
    Znajduje, uruchamia i łączy narzędzia CLI tk zamiast serwera MCP lub jednorazowego skryptu, na przykład do API lub CI.
  • 96add-tool
    Dodaje nowe narzędzie do agenta OCFT, które pozwala mu odpytywać dane, liczyć reguły lub przeszukiwać dokumenty.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.