Skip to main content

MCP Tools Reference

OpenPact exposes capabilities to AI models through MCP (Model Context Protocol) tools. This page documents all built-in tools.

What is MCP?

The Model Context Protocol (MCP) is a standard for connecting AI models to external tools and data sources. It provides:

  • Standardized Interface: Common format for tool definitions and invocations
  • Security Boundaries: Clear separation between AI and system capabilities
  • Extensibility: Easy addition of new tools without changing the core system

OpenPact implements MCP to give AI models controlled access to:

  • File systems (workspace, vault)
  • Communication channels (Discord, Telegram, Slack)
  • External services (GitHub, calendars, web)
  • Custom scripts (Starlark)

Security Model

All MCP tools in OpenPact follow the principle of least privilege:

  1. Explicit Enablement: Tools must be configured to be available
  2. Scoped Access: Tools can only access designated resources
  3. Secret Protection: API keys and tokens are never exposed to the AI
  4. Audit Trail: All tool invocations are logged
AI Model (cannot see secrets)


┌─────────────────────┐
│ MCP Tool Layer │ ← Tools defined here
│ (OpenPact) │
└─────────────────────┘


External Services (secrets injected here)

Built-in Tools

Workspace Tools

Tools for managing files in the ai-data/ subdirectory within the workspace. All workspace tools are scoped to ai-data/ -- the AI cannot access files in secure/.

workspace_read

Read a file from the workspace.

ParameterTypeRequiredDescription
pathstringYesRelative path within ai-data/

Example:

{
"name": "workspace_read",
"arguments": {
"path": "notes/todo.md"
}
}

Returns: File contents as string, or error if file doesn't exist.


workspace_write

Write content to a file in the ai-data/ directory.

ParameterTypeRequiredDescription
pathstringYesRelative path within ai-data/
contentstringYesContent to write

Example:

{
"name": "workspace_write",
"arguments": {
"path": "notes/new-note.md",
"content": "# My Note\n\nContent here..."
}
}

Returns: Success confirmation or error.


workspace_list

List files in the ai-data/ directory.

ParameterTypeRequiredDescription
pathstringNoRelative path within ai-data/ (defaults to ai-data/ root)

Example:

{
"name": "workspace_list",
"arguments": {
"path": "notes"
}
}

Returns: List of files and directories.


Memory Tools

Tools for reading and writing persistent memory.

memory_read

Read from a memory file.

ParameterTypeRequiredDescription
filestringNoMemory file name (defaults to MEMORY.md)

Example:

{
"name": "memory_read",
"arguments": {}
}

Returns: Memory file contents.


memory_write

Write to a memory file.

ParameterTypeRequiredDescription
contentstringYesContent to write
filestringNoMemory file name (defaults to MEMORY.md)
appendbooleanNoAppend instead of replace (default: false)

Example:

{
"name": "memory_write",
"arguments": {
"content": "## New Section\n\n- Important note",
"append": true
}
}

Returns: Success confirmation.


Communication Tools

chat_send

Send a message via any connected chat provider (Discord, Telegram, Slack).

ParameterTypeRequiredDescription
providerstringYesChat provider name (e.g., "discord", "telegram", "slack")
targetstringYesTarget: user:<id> for DMs, channel:<id> for channels, or just <id>
messagestringYesMessage content to send

The available providers are listed dynamically based on which providers are configured and connected.

Example (Discord):

{
"name": "chat_send",
"arguments": {
"provider": "discord",
"target": "123456789012345678",
"message": "Reminder: Team meeting in 15 minutes!"
}
}

Example (Telegram):

{
"name": "chat_send",
"arguments": {
"provider": "telegram",
"target": "98765432",
"message": "Build completed successfully!"
}
}

Example (Slack):

{
"name": "chat_send",
"arguments": {
"provider": "slack",
"target": "C12345678",
"message": "Deployment finished. All tests passed."
}
}

Returns: Success confirmation (e.g., "Message sent via discord to 123456789012345678") or error.

note

This tool is for proactive messaging. Normal conversation responses don't require this tool - they're handled automatically by each provider.


Model Tools

Tools for viewing available AI models and changing the default model used for new sessions.

model_list

List all available AI models grouped by provider, showing the current default.

ParameterTypeRequiredDescription
---No parameters

Example:

{
"name": "model_list",
"arguments": {}
}

Returns: Models grouped by provider with context/output limits, current default marked.


model_set_default

Set the default AI model for new sessions. Supports fuzzy matching — you can use a partial model name (e.g. "opus" or "sonnet") and the provider will be inferred automatically.

ParameterTypeRequiredDescription
modelstringYesModel ID or partial name to match (e.g. "claude-sonnet-4-20250514" or "opus")
providerstringNoProvider ID (e.g. "anthropic"). Inferred from model match if omitted.

Example (exact):

{
"name": "model_set_default",
"arguments": {
"model": "claude-opus-4-20250514",
"provider": "anthropic"
}
}

Example (fuzzy):

{
"name": "model_set_default",
"arguments": {
"model": "opus"
}
}

Returns: Confirmation with the matched model's full ID and limits, or an error with suggestions if the match is ambiguous or not found.

note

Changing the default model only affects new sessions. Existing sessions continue using the model they were started with.


Calendar Tools

calendar_read

Read events from configured calendar feeds.

ParameterTypeRequiredDescription
calendarstringNoCalendar name (reads all if not specified)
daysnumberNoNumber of days to look ahead (default: 7)

Example:

{
"name": "calendar_read",
"arguments": {
"calendar": "Personal",
"days": 14
}
}

Returns: List of events with title, time, and location.


Vault Tools

Tools for managing an Obsidian vault.

vault_read

Read a note from the vault.

ParameterTypeRequiredDescription
pathstringYesPath to note within vault

Example:

{
"name": "vault_read",
"arguments": {
"path": "Projects/ProjectX.md"
}
}

Returns: Note contents.


vault_write

Write a note to the vault.

ParameterTypeRequiredDescription
pathstringYesPath to note within vault
contentstringYesNote content

Example:

{
"name": "vault_write",
"arguments": {
"path": "Daily/2024-01-15.md",
"content": "# Daily Note\n\n## Tasks\n- [ ] Review code"
}
}

Returns: Success confirmation. If auto_sync is enabled, also commits to git.


vault_list

List notes in a vault directory.

ParameterTypeRequiredDescription
pathstringNoPath within vault (defaults to root)

Example:

{
"name": "vault_list",
"arguments": {
"path": "Projects"
}
}

Returns: List of notes and folders.


Search vault content.

ParameterTypeRequiredDescription
querystringYesSearch query

Example:

{
"name": "vault_search",
"arguments": {
"query": "meeting notes"
}
}

Returns: List of matching notes with excerpts.


Web Tools

web_fetch

Fetch and parse a web page.

ParameterTypeRequiredDescription
urlstringYesURL to fetch

Example:

{
"name": "web_fetch",
"arguments": {
"url": "https://example.com/api/docs"
}
}

Returns: Parsed content from the web page (HTML converted to readable text).

Rate Limiting

Web fetching is subject to rate limiting. Avoid excessive requests to the same domain.


GitHub Tools

github_list_issues

List issues from a GitHub repository.

ParameterTypeRequiredDescription
ownerstringYesRepository owner
repostringYesRepository name
statestringNoIssue state: open, closed, all (default: open)

Example:

{
"name": "github_list_issues",
"arguments": {
"owner": "open-pact",
"repo": "openpact",
"state": "open"
}
}

Returns: List of issues with title, number, labels, and assignees.


github_create_issue

Create a new GitHub issue.

ParameterTypeRequiredDescription
ownerstringYesRepository owner
repostringYesRepository name
titlestringYesIssue title
bodystringNoIssue body (markdown)
labelsstring[]NoLabels to apply

Example:

{
"name": "github_create_issue",
"arguments": {
"owner": "open-pact",
"repo": "openpact",
"title": "Add support for webhooks",
"body": "## Description\n\nWe should add webhook support for...",
"labels": ["enhancement"]
}
}

Returns: Created issue URL and number.


Script Tools

Tools for Starlark script execution.

script_list

List available Starlark scripts.

ParameterTypeRequiredDescription
---No parameters

Example:

{
"name": "script_list",
"arguments": {}
}

Returns: List of scripts with name, description, and required secrets.


script_run

Execute a named Starlark script.

ParameterTypeRequiredDescription
namestringYesScript name (without .star extension)
functionstringNoSpecific function to call
argsarrayNoArguments for the function

Example (run entire script):

{
"name": "script_run",
"arguments": {
"name": "weather"
}
}

Example (call specific function):

{
"name": "script_run",
"arguments": {
"name": "weather",
"function": "get_weather",
"args": ["London"]
}
}

Returns: Script output (with secrets automatically redacted).


script_exec

Execute arbitrary Starlark code.

ParameterTypeRequiredDescription
codestringYesStarlark code to execute

Example:

{
"name": "script_exec",
"arguments": {
"code": "result = 2 + 2\nprint(result)"
}
}

Returns: Execution output.

Approval Required

Arbitrary code execution may require approval depending on configuration.


script_reload

Reload scripts from disk.

ParameterTypeRequiredDescription
---No parameters

Example:

{
"name": "script_reload",
"arguments": {}
}

Returns: List of reloaded scripts.


Schedule Tools

Tools for managing scheduled jobs. Schedules run Starlark scripts or AI agent sessions on a cron timer.

schedule_list

List all scheduled jobs with their status and last run info.

ParameterTypeRequiredDescription
---No parameters

Example:

{
"name": "schedule_list",
"arguments": {}
}

Returns: List of schedules with ID, name, type, cron expression, enabled status, run_once flag, output target, and last run info.


schedule_create

Create a new scheduled job. Validates the cron expression at creation time.

ParameterTypeRequiredDescription
namestringYesHuman-readable name for the schedule
cron_exprstringYesCron expression (5 fields: min hour dom month dow)
typestringYesJob type: "script" or "agent"
script_namestringNoScript filename (required for type "script", e.g. "my_script.star")
promptstringNoPrompt for AI session (required for type "agent")
enabledbooleanNoWhether the schedule is active (default: true)
output_providerstringNoChat provider to send output to (e.g. "discord")
output_channelstringNoChannel ID to send output to (e.g. "channel:123456")
run_oncebooleanNoIf true, the schedule auto-disables after one execution

Example (script job):

{
"name": "schedule_create",
"arguments": {
"name": "Daily report",
"cron_expr": "0 9 * * 1-5",
"type": "script",
"script_name": "daily_report.star"
}
}

Example (agent job with output):

{
"name": "schedule_create",
"arguments": {
"name": "Status update",
"cron_expr": "0 */2 * * *",
"type": "agent",
"prompt": "Summarize today's open issues and post a status update.",
"output_provider": "discord",
"output_channel": "channel:123456789"
}
}

Returns: Confirmation with the new schedule's ID and name.


schedule_update

Update an existing scheduled job by ID. Only provided fields are updated.

ParameterTypeRequiredDescription
idstringYesSchedule ID to update
namestringNoNew name
cron_exprstringNoNew cron expression
typestringNoNew job type: "script" or "agent"
script_namestringNoNew script name
promptstringNoNew prompt
output_providerstringNoChat provider for output delivery
output_channelstringNoChannel ID for output delivery
run_oncebooleanNoIf true, the schedule auto-disables after one execution

Example:

{
"name": "schedule_update",
"arguments": {
"id": "a1b2c3d4e5f6g7h8",
"cron_expr": "0 10 * * 1-5",
"name": "Morning report"
}
}

Returns: Confirmation with the updated schedule's ID and name.


schedule_delete

Delete a scheduled job by ID.

ParameterTypeRequiredDescription
idstringYesSchedule ID to delete

Example:

{
"name": "schedule_delete",
"arguments": {
"id": "a1b2c3d4e5f6g7h8"
}
}

Returns: Confirmation that the schedule was deleted.


schedule_enable

Enable a scheduled job by ID.

ParameterTypeRequiredDescription
idstringYesSchedule ID to enable

Example:

{
"name": "schedule_enable",
"arguments": {
"id": "a1b2c3d4e5f6g7h8"
}
}

Returns: Confirmation that the schedule was enabled.


schedule_disable

Disable a scheduled job by ID. The job stops running but its configuration is preserved.

ParameterTypeRequiredDescription
idstringYesSchedule ID to disable

Example:

{
"name": "schedule_disable",
"arguments": {
"id": "a1b2c3d4e5f6g7h8"
}
}

Returns: Confirmation that the schedule was disabled.


Tool Summary Table

ToolCategoryDescription
workspace_readWorkspaceRead files from ai-data/
workspace_writeWorkspaceWrite files to ai-data/
workspace_listWorkspaceList ai-data/ files
memory_readMemoryRead memory files
memory_writeMemoryWrite to memory files
chat_sendCommunicationSend messages via any chat provider
model_listModelsList available AI models
model_set_defaultModelsChange the default model for new sessions
calendar_readCalendarRead calendar events
vault_readVaultRead Obsidian notes
vault_writeVaultWrite Obsidian notes
vault_listVaultList vault notes
vault_searchVaultSearch vault content
web_fetchWebFetch web pages
github_list_issuesGitHubList repository issues
github_create_issueGitHubCreate new issues
script_listScriptsList Starlark scripts
script_runScriptsRun named scripts
script_execScriptsExecute Starlark code
script_reloadScriptsReload scripts from disk
schedule_listSchedulesList all scheduled jobs
schedule_createSchedulesCreate a new scheduled job
schedule_updateSchedulesUpdate an existing scheduled job
schedule_deleteSchedulesDelete a scheduled job
schedule_enableSchedulesEnable a scheduled job
schedule_disableSchedulesDisable a scheduled job