Skip to content

The SDK lets you extend your agent’s capabilities using custom Python functions, built-in web tools, built-in system tools, and agent skills.

For Model Context Protocol (MCP) server configuration, see the MCP Documentation.

The SDK provides identifiers for built-in system tools through the BuiltinTools enum (google.antigravity.types.BuiltinTools).

IdentifierEnum constantDescription
list_directoryBuiltinTools.LIST_DIRList directory contents.
search_directoryBuiltinTools.SEARCH_DIRSearch within files.
find_fileBuiltinTools.FIND_FILEFind files by pattern.
view_fileBuiltinTools.VIEW_FILERead file contents.
create_fileBuiltinTools.CREATE_FILECreate a new file.
edit_fileBuiltinTools.EDIT_FILEEdit an existing file.
run_commandBuiltinTools.RUN_COMMANDExecute a shell command.
ask_questionBuiltinTools.ASK_QUESTIONPrompt user for input.
start_subagentBuiltinTools.START_SUBAGENTInvoke a child subagent.
generate_imageBuiltinTools.GENERATE_IMAGEGenerate or edit images.
search_webBuiltinTools.SEARCH_WEBPerform Google Search.
read_url_contentBuiltinTools.READ_URL_CONTENTFetch URL content.
finishBuiltinTools.FINISHReturn final output.

In some cases you may want to restrict the tools that your agent can access. You can control the agent’s active tools in CapabilitiesConfig with enabled_tools or disabled_tools.

For example, you can configure your agent to only have access to read_only built-in tools:

from google.antigravity import LocalAgentConfig, CapabilitiesConfig
from google.antigravity.types import BuiltinTools

config = LocalAgentConfig(
    capabilities=CapabilitiesConfig(
        enabled_tools=BuiltinTools.read_only()
    )
)

In some cases you may want to create custom Python functions that your agent can leverage. You can register custom Python functions in LocalAgentConfig as tools for your agent.

For example, you can configure your agent to leverage a custom get_weather function:

from google.antigravity import Agent, LocalAgentConfig

def get_weather(city: str) -> str:
    """Returns the current weather for a city."""
    return f"It's sunny in {city}."

config = LocalAgentConfig(tools=[get_weather])

async with Agent(config) as agent:
    response = await agent.chat("What's the weather in Tokyo?")
    print(await response.text())

Web search (SEARCH_WEB) and URL fetching (READ_URL_CONTENT) tools are enabled by default.

For example, you can ask your agent to perform Google searches or read web pages:

from google.antigravity import Agent, LocalAgentConfig

config = LocalAgentConfig()

async with Agent(config) as agent:
    response = await agent.chat("Search for latest updates on Gemini.")
    print(await response.text())

In LocalAgentConfig, skills_paths accepts paths to individual skill directories containing a SKILL.md file, as well as parent directories containing multiple skill subdirectories.

For example, you can configure your agent to leverage a custom code-review skill:

from google.antigravity import Agent, LocalAgentConfig

config = LocalAgentConfig(
    skills_paths=["/path/to/skills/code-review"],
)

async with Agent(config) as agent:
    response = await agent.chat("Run a code quality audit.")
    print(await response.text())

For full working code examples, see the GitHub repository: