The GeminiToolsProvider is implemented in packages/agent-sdk/src/create_something_agents/providers/gemini_tools.py and serves as a specialized AgentProvider that extends Gemini's capabilities
with custom tool definitions. Unlike a generic Gemini provider, this implementation directly
injects bash and file_read as callable functions, allowing the
model to interact with the monorepo.
The provider's _build_tools method (lines 100-109) constructs FunctionDeclaration objects for both tools, making them available to the
Gemini model for function calling. This allows the LLM to dynamically decide when and
how to use these tools based on the task at hand.
Tool Schema Definitions
# From gemini_tools.py (Lines 14-26)
BASH_TOOL_SCHEMA = {
"name": "bash",
"description": "Execute a bash command in the monorepo. Use for searching code (grep), listing files, or running simple commands. Do NOT use for destructive operations.",
"parameters": {
"type": "object",
"properties": {
"command": {
"type": "string",
"description": "The bash command to execute."
}
},
"required": ["command"]
}
}
# Lines 28-45
FILE_READ_TOOL_SCHEMA = {
"name": "file_read",
"description": "Read the contents of a file. Use to examine source code, configuration files, or documentation.",
"parameters": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "Path to the file relative to monorepo root."
},
"start_line": { "type": "integer" },
"end_line": { "type": "integer" }
},
"required": ["path"]
}
}
What We Did
- Defined explicit
BASH_TOOL_SCHEMA and FILE_READ_TOOL_SCHEMA for Gemini's function calling interface. - Implemented
_execute_bash and _execute_file_read methods within the provider. - Integrated these tools into the Gemini client via
FunctionDeclaration objects.
The tools are integrated into Gemini's reasoning process—the model decides when to search
and when to read files. The outcome: a provider that generates papers with real file paths
and line numbers.