Skip to main content
Logicore ships a default registry of tools for the most common agent tasks. Enable them all with a single flag, or load them selectively.

Enabling built-in tools

from logicore import Agent

agent = Agent(
    llm="ollama",
    tools=True
)
Both paths load ALL_TOOL_SCHEMAS from the global ToolRegistry defined in logicore/tools/registry.py.

Tool categories

Filesystem

Tools for reading, creating, editing, deleting, and searching files. read_file must be called before edit_file.
Read file contents with an optional line range. Also tracks which files have been read, which edit_file requires.
ParameterTypeRequiredDescription
file_pathstrYesPath to the file.
start_lineintNoStarting line number (1-indexed).
end_lineintNoEnding line number (1-indexed).
reply = await agent.chat("Read the first 20 lines of src/main.py")
Create a new file or directory. Will not overwrite an existing file unless overwrite=true.
ParameterTypeRequiredDescription
file_pathstrYesPath for the new file or directory.
contentstrYesFile content. Use "" for directories.
file_typestrNo"file" (default) or "directory".
overwriteboolNoOverwrite an existing file. Default false.
Modify an existing file. Supports exact text replacement or line-range replacement. Requires read_file to have been called first.
ParameterTypeRequiredDescription
file_pathstrYesPath to the file to edit.
new_textstrYesReplacement text.
old_textstrNoExact text to replace (required if not using line range).
replace_allboolNoReplace all occurrences. Default false.
start_lineintNoStart line for range replacement (1-indexed).
end_lineintNoEnd line for range replacement (1-indexed).
Remove a file or directory. Requires recursive=true for non-empty directories.
ParameterTypeRequiredDescription
file_pathstrYesPath to delete.
recursiveboolNoDelete directories and their contents. Default false.
Browse directory contents. Supports glob patterns, recursive listing, and a visual tree view.
ParameterTypeRequiredDescription
directorystrNoDirectory path. Default ".".
patternstrNoFile glob pattern. Default "*".
recursiveboolNoList subdirectories. Default false.
show_hiddenboolNoInclude hidden files. Default false.
treeboolNoReturn output as a visual tree. Default false.
ignore_patternslistNoPatterns to skip. Default excludes __pycache__, .git, node_modules, etc.
Find text patterns across files. Supports substring, regex, exact, and fuzzy matching.
ParameterTypeRequiredDescription
patternstrYesText or regex to search for.
file_patternstrNoGlob filter, e.g. "*.py". Default "*".
directorystrNoDirectory to search. Default ".".
case_sensitiveboolNoCase-sensitive search. Default false.
pattern_typestrNo"substring" (default), "regex", "exact", or "fuzzy".
max_resultsintNoCap on results. Default 100.
context_linesintNoLines of context around each match. Default 0.
group_by_fileboolNoGroup results by filename. Default false.
Quick keyword or regex search across a directory. An alias for search_files with a simpler parameter set.
ParameterTypeRequiredDescription
keywordstrYesKeyword or regex pattern.
directorystrNoDirectory to search. Default ".".
file_patternstrNoGlob pattern to filter files.

Execution

Run a shell command. Prefer the dedicated file tools for file manipulation.
ParameterTypeRequiredDescription
commandstrYesShell command to run.
command_typestrNo"bash" (default), "powershell", "cmd", or "python".
working_directorystrNoAbsolute path to run the command in.
timeoutintNoMax execution time in seconds (1–300). Default 300.
ignore_errorboolNoTreat non-zero exit codes as success. Default false.
reply = await agent.chat("Run pytest and show me the summary")
Execute ephemeral Python code in an isolated subprocess. Use for calculations and data processing, not for file modifications.
ParameterTypeRequiredDescription
codestrYesSelf-contained Python code to run.
timeoutintNoMax execution time in seconds (1–300). Default 60.

Git

Execute a git command. Do not include the git prefix.
ParameterTypeRequiredDescription
commandstrYesGit subcommand and arguments, e.g. "status" or "commit -m 'fix bug'".
working_directorystrNoAbsolute path to the repository root.
reply = await agent.chat("Check git status and commit all changes with message 'chore: update deps'")

Web and fetch

Fetch and extract clean text from a URL. Returns readable text, not raw HTML.
ParameterTypeRequiredDescription
urlstrYesURL to fetch.

Documents

Read and extract content from PDF, DOCX, PPTX, XLSX, and other document formats.
ParameterTypeRequiredDescription
file_pathstrYesAbsolute path to the document.
output_formatstrNo"markdown" (default), "text", or "metadata".
Convert a document from one format to another. Uses Pandoc where applicable. The output format is determined by the extension of output_path.
ParameterTypeRequiredDescription
input_pathstrYesAbsolute path to the source document.
output_pathstrYesAbsolute path to the converted output.

Office documents

Create a new PowerPoint presentation.
ParameterTypeRequiredDescription
file_pathstrYesPath for the new .pptx file.
titlestrYesPresentation title.
subtitlestrNoSubtitle or author name.
slideslistNoList of {"title": "...", "content": "..."} dicts for content slides.
Replace text in an existing PowerPoint file.
ParameterTypeRequiredDescription
file_pathstrYesPath to the .pptx file.
old_textstrYesText to find and replace.
new_textstrYesReplacement text.
slide_indexintNoTarget a specific slide (0-indexed). Searches all slides if omitted.
replace_allboolNoReplace all occurrences. Default true.
Add a new slide to an existing PowerPoint file.
ParameterTypeRequiredDescription
file_pathstrYesPath to the .pptx file.
titlestrYesSlide title.
contentstrYesSlide body text or bullet points.
layout_indexintNoSlide layout index (0 = Title, 1 = Content). Default 1.
Create a new Word document.
ParameterTypeRequiredDescription
file_pathstrYesPath for the new .docx file.
contentstrYesInitial text content.
Replace text in an existing Word document. Also searches inside tables.
ParameterTypeRequiredDescription
file_pathstrYesPath to the .docx file.
old_textstrYesText to replace.
new_textstrYesReplacement text.
Create a new Excel workbook with a single sheet.
ParameterTypeRequiredDescription
file_pathstrYesPath for the new .xlsx file.
sheet_namestrNoName of the initial sheet. Default "Sheet1".
Write a value to a specific cell in an Excel sheet.
ParameterTypeRequiredDescription
file_pathstrYesPath to the .xlsx file.
cellstrYesCell coordinate, e.g. "A1".
valuestrYesNew cell value.
sheet_namestrNoTarget sheet name. Default "Sheet1".

PDF tools

Merge multiple PDF files into a single PDF in the specified order.
ParameterTypeRequiredDescription
output_pathstrYesPath for the merged output PDF.
input_pathslistYesOrdered list of input PDF paths.
Split a PDF into individual per-page files saved to an output directory.
ParameterTypeRequiredDescription
input_pathstrYesPath to the source PDF.
output_dirstrYesDirectory to save the split pages.

Media

Scheduling (cron)

Schedule a new recurring job with persistent storage and restart recovery.
ParameterTypeRequiredDescription
namestrYesShort name for the job.
messagestrYesMessage delivered when the job fires.
cron_expressionstrYes5-field cron expression: minute hour day month weekday, e.g. "0 9 * * 1-5".
reply = await agent.chat(
    "Create a cron job named 'daily-standup' with cron '0 9 * * 1-5' "
    "and message 'Post standup reminder'"
)
List all scheduled cron jobs.
ParameterTypeRequiredDescription
include_disabledboolNoInclude disabled jobs. Default false.
Delete a scheduled job by its ID.
ParameterTypeRequiredDescription
job_idstrYesThe job ID returned by add_cron_job or list_cron_jobs.
Return structured cron metadata and the last five execution records for each active job as JSON.
ParameterTypeRequiredDescription
include_disabledboolNoInclude disabled jobs. Default false.

Smart agent tools

The following tools are defined in logicore/tools/agent_tools.py and used by SmartAgent. They can also be loaded manually.
Get the current date and time or perform date formatting operations.
ParameterTypeRequiredDescription
operationstrNo"now" (default), "format", "parse", or "diff".
format_stringstrNostrftime format string for "format" operation, e.g. "%Y-%m-%d".
timezonestrNoTimezone name, e.g. "UTC" or "America/New_York".
The "now" operation returns ISO, date, time, datetime, day of week, Unix timestamp, and human-readable strings.
Create, search, list, retrieve, and delete persistent notes. Notes are stored across sessions.
ParameterTypeRequiredDescription
actionstrYes"add", "list", "search", "get", or "delete".
titlestrNoNote title (required for "add").
contentstrNoNote body (required for "add").
querystrNoSearch string (required for "search").
note_idintNoNote ID (required for "get" and "delete").
tagslistNoList of tag strings for categorization.
Store and retrieve learned knowledge, approaches, and patterns using the project memory system.
ParameterTypeRequiredDescription
actionstrYes"store", "search", "list", "export", or "set_project".
memory_typestrNo"approach", "learning", "key_step", "pattern", "preference", "decision", or "context". Required for "store".
titlestrNoMemory title (required for "store").
contentstrNoMemory body (required for "store").
querystrNoSearch query (required for "search").
project_idstrNoProject ID to associate with or filter by.
limitintNoMaximum results to return. Default 10.
Enhanced shell execution with optional learning capture. Wraps execute_command with the ability to store successful commands as project memories.
ParameterTypeRequiredDescription
commandstrYesShell command to execute.
purposestrNoShort description used as the memory title if capture_learning is true.
working_dirstrNoWorking directory for the command.
timeoutintNoTimeout in seconds (1–300). Default 60.
capture_learningboolNoStore the command as a key_step memory if it succeeds. Default false.
Structured reasoning and planning tool. Use before executing complex multi-step tasks to decompose the problem and formulate a strategy.
ParameterTypeRequiredDescription
thoughtstrYesReasoning, analysis, or thought process.
conclusionstrNoThe conclusion or execution roadmap reached after thinking.
SmartAgent loads datetime, notes, memory, and bash by default. think is available but intentionally excluded from the default SmartAgent load.

Usage examples

from logicore import Agent

agent = Agent(llm="ollama", tools=True)

reply = await agent.chat(
    "Read docs/quickstart.md and create a 5-point setup checklist in docs/setup-checklist.md"
)
print(reply)

Approval and safety model

Built-in tools are pre-classified into three risk tiers:
TierTools
Safe — no approval neededread_file, list_files, search_files, fast_grep, read_document, media_search, list_cron_jobs, get_crons
Approval requiredcreate_file, edit_file, web_search, image_search, url_fetch, convert_document, edit_pptx, create_pptx, append_slide, edit_docx, create_docx, edit_excel, create_excel, merge_pdfs, split_pdf, add_cron_job, remove_cron_job
Dangerousdelete_file, execute_command, git_command, code_execute
To disable approval checks in trusted environments:
agent.set_auto_approve_all(True)
To implement custom approval logic, see the approval workflow section in the custom tools guide.

Environment variables

VariableRequired by
GOOGLE_API_KEYweb_search, image_search, media_search
GOOGLE_CXweb_search, image_search, media_search
YOUTUBE_API_KEYmedia_search (optional; falls back to GOOGLE_API_KEY)

File-to-tool map

Source fileTool names
filesystem.pyread_file, create_file, edit_file, delete_file, list_files, search_files, fast_grep
execution.pyexecute_command, code_execute
web.pyweb_search, url_fetch, image_search
git.pygit_command
document.pyread_document
convert_document.pyconvert_document
office_tools.pyedit_pptx, create_pptx, append_slide, edit_docx, create_docx, edit_excel, create_excel
pdf_tools.pymerge_pdfs, split_pdf
media_search.pymedia_search
cron_tools.pyadd_cron_job, list_cron_jobs, remove_cron_job, get_crons
agent_tools.pydatetime, notes, memory, bash, think

Build docs developers (and LLMs) love