Extends timeline() with Jira integration since sessions moved to Jira-only in
CF-836 (2026-02-08) and the session-mcp tables are empty by design.
Adds to services/jira.ts:
- getIssueWithHistory(key): fetches issue with expand=changelog + comments
- searchIssueKeys(jql): JQL search returning minimal issue keys
- ADF → plain text extractor for comment bodies
Timeline now yields Jira events: issue_created, field_change:{status,assignee,
resolution,priority,labels}, comment. Events are time-filtered client-side
against the since/until window. For Jira-key subjects, also searches for
linked session-tracking issues and merges their events.
Tested against CF-2872 (audit task) and CF-2885 (this ticket) — shows full
lifecycle from creation through transitions to resolution.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
769 lines
30 KiB
TypeScript
769 lines
30 KiB
TypeScript
// Tool definitions for session-mcp
|
|
// Forked from task-mcp (CF-762): Removed task/epic/version/search/relations tools
|
|
// Those are now handled by Jira Cloud via mcp-atlassian
|
|
|
|
export const toolDefinitions = [
|
|
// Delegation Tools (kept for tracking code generation jobs)
|
|
{
|
|
name: 'task_delegations',
|
|
description: 'List delegations for a specific Jira issue (quality scores, backends, status)',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
task_id: { type: 'string', description: 'Jira issue key (e.g., CF-123)' },
|
|
},
|
|
required: ['task_id'],
|
|
},
|
|
},
|
|
{
|
|
name: 'task_delegation_query',
|
|
description: 'Query delegations across tasks (filter by status, backend)',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
status: { type: 'string', enum: ['pending', 'success', 'failed', 'partial'], description: 'Filter by delegation status' },
|
|
backend: { type: 'string', description: 'Filter by backend (e.g., grok, haiku)' },
|
|
limit: { type: 'number', description: 'Max results (default: 20)' },
|
|
},
|
|
},
|
|
},
|
|
|
|
// Commit Tools (kept for git-session linking)
|
|
{
|
|
name: 'task_commit_add',
|
|
description: 'Link a git commit to a Jira issue key (SHA reference only)',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
task_id: { type: 'string', description: 'Jira issue key (e.g., CF-123)' },
|
|
commit_sha: { type: 'string', description: 'Git commit SHA (full or short)' },
|
|
repo: { type: 'string', description: 'Repository (e.g., christian/VPN)' },
|
|
source: { type: 'string', enum: ['manual', 'parsed', 'pr_merge'], description: 'How the link was created (default: manual)' },
|
|
},
|
|
required: ['task_id', 'commit_sha', 'repo'],
|
|
},
|
|
},
|
|
{
|
|
name: 'task_commit_remove',
|
|
description: 'Remove a commit link from a Jira issue',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
task_id: { type: 'string', description: 'Jira issue key' },
|
|
commit_sha: { type: 'string', description: 'Commit SHA to unlink' },
|
|
},
|
|
required: ['task_id', 'commit_sha'],
|
|
},
|
|
},
|
|
{
|
|
name: 'task_commits_list',
|
|
description: 'List commits linked to a Jira issue',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
task_id: { type: 'string', description: 'Jira issue key' },
|
|
},
|
|
required: ['task_id'],
|
|
},
|
|
},
|
|
{
|
|
name: 'task_link_commits',
|
|
description: 'Parse commit messages for Jira issue references and create links (batch operation)',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
repo: { type: 'string', description: 'Repository (e.g., christian/VPN)' },
|
|
commits: {
|
|
type: 'array',
|
|
description: 'Array of commits with sha and message',
|
|
items: {
|
|
type: 'object',
|
|
properties: {
|
|
sha: { type: 'string' },
|
|
message: { type: 'string' },
|
|
},
|
|
required: ['sha', 'message'],
|
|
},
|
|
},
|
|
dry_run: { type: 'boolean', description: 'Preview without creating links (default: false)' },
|
|
},
|
|
required: ['repo', 'commits'],
|
|
},
|
|
},
|
|
{
|
|
name: 'session_tasks',
|
|
description: 'List Jira issues worked on in a session (from task_activity tracking)',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
session_id: { type: 'string', description: 'Session ID (supports * wildcard)' },
|
|
limit: { type: 'number', description: 'Max results (default: 20)' },
|
|
},
|
|
required: ['session_id'],
|
|
},
|
|
},
|
|
|
|
// Infrastructure Changelog Tools
|
|
{
|
|
name: 'changelog_add',
|
|
description: 'Add infrastructure change entry for session awareness',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
date: { type: 'string', description: 'Change date (YYYY-MM-DD)' },
|
|
title: { type: 'string', description: 'Short title (max 100 chars)' },
|
|
change_description: { type: 'string', description: 'What changed' },
|
|
impact: { type: 'string', description: 'Effects on existing infrastructure' },
|
|
actions_required: { type: 'string', description: 'Steps developers need to take (optional)' },
|
|
session_id: { type: 'string', description: 'Session that implemented change (optional)' },
|
|
task_ids: { type: 'array', items: { type: 'string' }, description: 'Related Jira issue keys (optional)' },
|
|
},
|
|
required: ['date', 'title', 'change_description', 'impact'],
|
|
},
|
|
},
|
|
{
|
|
name: 'changelog_since_session',
|
|
description: 'Get infrastructure changes since last session for a project. Use at session start.',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
project: { type: 'string', description: 'Project key (e.g., CF, VPN) to find last session' },
|
|
},
|
|
required: ['project'],
|
|
},
|
|
},
|
|
{
|
|
name: 'changelog_list',
|
|
description: 'List recent infrastructure changes by time period',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
days_back: { type: 'number', description: 'Days to look back (default: 7)' },
|
|
limit: { type: 'number', description: 'Max results (default: 20)' },
|
|
},
|
|
},
|
|
},
|
|
|
|
// Event Timeline (CF-2885)
|
|
{
|
|
name: 'timeline',
|
|
description: 'Unified chronological event timeline for a subject. Stitches sessions, notes, commits, plans, and task-commit links from all sessions touching the subject. Subject can be a Jira issue key (e.g., CF-2872), a session id, or a project key (e.g., CF). Returns events sorted oldest → newest.',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
subject: { type: 'string', description: 'Jira issue key (CF-123), session id, or project key (CF)' },
|
|
since: { type: 'string', description: 'ISO8601 timestamp or relative "-7d"/"-24h"/"-30m" (default: -7d)' },
|
|
until: { type: 'string', description: 'ISO8601 timestamp (default: now)' },
|
|
sources: {
|
|
type: 'array',
|
|
items: { type: 'string', enum: ['session', 'note', 'commit', 'plan', 'task_commit', 'jira'] },
|
|
description: 'Optional filter: which event sources to include (default: all). Jira source pulls issue history (transitions, comments, field changes) via the AgilitonAPI gateway.',
|
|
},
|
|
limit: { type: 'number', description: 'Max events to return (default: 100)' },
|
|
},
|
|
required: ['subject'],
|
|
},
|
|
},
|
|
|
|
// Project Lock Tools
|
|
{
|
|
name: 'project_lock',
|
|
description: 'Lock a project for exclusive session access.',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
project: { type: 'string', description: 'Project key (e.g., VPN, ST)' },
|
|
session_id: { type: 'string', description: 'Unique session identifier' },
|
|
duration_minutes: { type: 'number', description: 'Lock duration in minutes (default: 120)' },
|
|
reason: { type: 'string', description: 'Optional reason for locking' },
|
|
},
|
|
required: ['project', 'session_id'],
|
|
},
|
|
},
|
|
{
|
|
name: 'project_unlock',
|
|
description: 'Release a project lock',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
project: { type: 'string', description: 'Project key to unlock' },
|
|
session_id: { type: 'string', description: 'Session ID (must match lock owner unless force=true)' },
|
|
force: { type: 'boolean', description: 'Force unlock even if owned by different session' },
|
|
},
|
|
required: ['project'],
|
|
},
|
|
},
|
|
{
|
|
name: 'project_lock_status',
|
|
description: 'Check lock status for a project or all projects',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
project: { type: 'string', description: 'Project key (optional, shows all if omitted)' },
|
|
},
|
|
},
|
|
},
|
|
{
|
|
name: 'project_context',
|
|
description: 'Get project context from current directory - returns detected project, lock status, recent sessions.',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {},
|
|
},
|
|
},
|
|
|
|
// Impact Analysis Tools
|
|
{
|
|
name: 'component_register',
|
|
description: 'Register a system component for impact analysis tracking',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
id: { type: 'string', description: 'Unique component ID' },
|
|
name: { type: 'string', description: 'Human-readable name' },
|
|
type: { type: 'string', enum: ['service', 'script', 'config', 'database', 'api', 'ui', 'library'], description: 'Component type' },
|
|
path: { type: 'string', description: 'File system path or Docker container name' },
|
|
repo: { type: 'string', description: 'Git repository' },
|
|
description: { type: 'string', description: 'What this component does' },
|
|
health_check: { type: 'string', description: 'Command or URL to check health' },
|
|
},
|
|
required: ['id', 'name', 'type'],
|
|
},
|
|
},
|
|
{
|
|
name: 'component_list',
|
|
description: 'List registered components, optionally filtered by type',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
type: { type: 'string', enum: ['service', 'script', 'config', 'database', 'api', 'ui', 'library'], description: 'Filter by component type' },
|
|
},
|
|
},
|
|
},
|
|
{
|
|
name: 'component_add_dependency',
|
|
description: 'Add a dependency between two components',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
component_id: { type: 'string', description: 'Source component ID' },
|
|
depends_on: { type: 'string', description: 'Target component ID' },
|
|
dependency_type: { type: 'string', enum: ['hard', 'soft', 'config', 'data'], description: 'Type of dependency' },
|
|
description: { type: 'string', description: 'Description of the dependency' },
|
|
},
|
|
required: ['component_id', 'depends_on', 'dependency_type'],
|
|
},
|
|
},
|
|
{
|
|
name: 'component_add_file',
|
|
description: 'Map a file pattern to a component (for git diff analysis)',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
component_id: { type: 'string', description: 'Component ID' },
|
|
file_pattern: { type: 'string', description: 'File pattern (e.g., src/services/*.py)' },
|
|
},
|
|
required: ['component_id', 'file_pattern'],
|
|
},
|
|
},
|
|
{
|
|
name: 'component_add_check',
|
|
description: 'Add a verification check to a component',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
component_id: { type: 'string', description: 'Component ID' },
|
|
name: { type: 'string', description: 'Check name' },
|
|
check_type: { type: 'string', enum: ['command', 'http', 'tcp', 'file'], description: 'Type of check' },
|
|
check_command: { type: 'string', description: 'Command/URL to execute' },
|
|
expected_result: { type: 'string', description: 'Expected output or status' },
|
|
timeout_seconds: { type: 'number', description: 'Timeout in seconds (default: 30)' },
|
|
},
|
|
required: ['component_id', 'name', 'check_type', 'check_command'],
|
|
},
|
|
},
|
|
{
|
|
name: 'impact_analysis',
|
|
description: 'Analyze which components are affected by file changes',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
changed_files: { type: 'array', items: { type: 'string' }, description: 'List of changed file paths' },
|
|
},
|
|
required: ['changed_files'],
|
|
},
|
|
},
|
|
{
|
|
name: 'impact_learn',
|
|
description: 'Record a learned impact relationship',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
changed_component: { type: 'string', description: 'Component that was changed' },
|
|
affected_component: { type: 'string', description: 'Component that was unexpectedly affected' },
|
|
impact_description: { type: 'string', description: 'What went wrong' },
|
|
error_id: { type: 'string', description: 'Related error ID' },
|
|
task_id: { type: 'string', description: 'Related Jira issue key' },
|
|
},
|
|
required: ['changed_component', 'affected_component', 'impact_description'],
|
|
},
|
|
},
|
|
{
|
|
name: 'component_graph',
|
|
description: 'Get component dependency graph',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
component_id: { type: 'string', description: 'Center component (optional, shows all if omitted)' },
|
|
},
|
|
},
|
|
},
|
|
|
|
// Tool Documentation Tools
|
|
{
|
|
name: 'tool_doc_add',
|
|
description: 'Add a new tool documentation entry',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
tool_name: { type: 'string', description: 'Tool or command name' },
|
|
category: { type: 'string', enum: ['mcp', 'cli', 'script', 'internal', 'deprecated'], description: 'Tool category' },
|
|
title: { type: 'string', description: 'Short descriptive title' },
|
|
description: { type: 'string', description: 'Detailed description' },
|
|
usage_example: { type: 'string', description: 'Usage example (optional)' },
|
|
parameters: { type: 'object', description: 'Parameter definitions (optional)' },
|
|
notes: { type: 'string', description: 'Additional notes (optional)' },
|
|
tags: { type: 'array', items: { type: 'string' }, description: 'Searchable tags (optional)' },
|
|
source_file: { type: 'string', description: 'Original source file (optional)' },
|
|
},
|
|
required: ['tool_name', 'category', 'title', 'description'],
|
|
},
|
|
},
|
|
{
|
|
name: 'tool_doc_search',
|
|
description: 'Search tool documentation semantically',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
query: { type: 'string', description: 'Search query' },
|
|
category: { type: 'string', enum: ['mcp', 'cli', 'script', 'internal', 'deprecated'], description: 'Filter by category (optional)' },
|
|
tags: { type: 'array', items: { type: 'string' }, description: 'Filter by tags (optional)' },
|
|
limit: { type: 'number', description: 'Max results (default: 5)' },
|
|
},
|
|
required: ['query'],
|
|
},
|
|
},
|
|
{
|
|
name: 'tool_doc_get',
|
|
description: 'Get specific tool documentation by name',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
tool_name: { type: 'string', description: 'Tool or command name' },
|
|
},
|
|
required: ['tool_name'],
|
|
},
|
|
},
|
|
{
|
|
name: 'tool_doc_list',
|
|
description: 'List tool documentation entries',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
category: { type: 'string', enum: ['mcp', 'cli', 'script', 'internal', 'deprecated'], description: 'Filter by category (optional)' },
|
|
tag: { type: 'string', description: 'Filter by tag (optional)' },
|
|
limit: { type: 'number', description: 'Max results (default: 20)' },
|
|
},
|
|
},
|
|
},
|
|
{
|
|
name: 'tool_doc_export',
|
|
description: 'Export all tool documentation as markdown',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {},
|
|
},
|
|
},
|
|
|
|
// Session Management Tools
|
|
{
|
|
name: 'session_start',
|
|
description: 'Start a new session with metadata tracking. Links to Jira issue key.',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
session_id: { type: 'string', description: 'Session ID (auto-generated if not provided)' },
|
|
project: { type: 'string', description: 'Project key (e.g., CF, VPN)' },
|
|
jira_issue_key: { type: 'string', description: 'Jira issue key being worked on (e.g., CF-123)' },
|
|
working_directory: { type: 'string', description: 'Current working directory' },
|
|
git_branch: { type: 'string', description: 'Current git branch' },
|
|
initial_prompt: { type: 'string', description: 'First user message' },
|
|
},
|
|
required: ['project'],
|
|
},
|
|
},
|
|
{
|
|
name: 'session_update',
|
|
description: 'Update session metrics (message count, tokens, tools used)',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
session_id: { type: 'string', description: 'Session ID to update' },
|
|
message_count: { type: 'number', description: 'Number of messages exchanged' },
|
|
token_count: { type: 'number', description: 'Total tokens used' },
|
|
tools_used: { type: 'array', items: { type: 'string' }, description: 'Array of tool names used' },
|
|
},
|
|
required: ['session_id'],
|
|
},
|
|
},
|
|
{
|
|
name: 'session_end',
|
|
description: 'End session and generate summary with embedding',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
session_id: { type: 'string', description: 'Session ID to end' },
|
|
summary: { type: 'string', description: 'Session summary text' },
|
|
status: { type: 'string', enum: ['completed', 'interrupted'], description: 'Session completion status (default: completed)' },
|
|
},
|
|
required: ['session_id', 'summary'],
|
|
},
|
|
},
|
|
{
|
|
name: 'session_list',
|
|
description: 'List sessions with filtering and pagination',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
project: { type: 'string', description: 'Filter by project key' },
|
|
status: { type: 'string', enum: ['active', 'completed', 'interrupted'], description: 'Filter by status' },
|
|
since: { type: 'string', description: 'Show sessions since date (ISO format)' },
|
|
limit: { type: 'number', description: 'Max results (default: 20)' },
|
|
},
|
|
},
|
|
},
|
|
{
|
|
name: 'session_search',
|
|
description: 'Find similar sessions using hybrid (vector + keyword), vector-only, or keyword-only search.',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
query: { type: 'string', description: 'Search query' },
|
|
project: { type: 'string', description: 'Filter by project (optional)' },
|
|
limit: { type: 'number', description: 'Max results (default: 5)' },
|
|
search_mode: { type: 'string', enum: ['hybrid', 'vector', 'keyword'], description: 'Search mode (default: hybrid)' },
|
|
},
|
|
required: ['query'],
|
|
},
|
|
},
|
|
{
|
|
name: 'session_context',
|
|
description: 'Get complete context: Jira issues, commits, builds, memories',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
session_id: { type: 'string', description: 'Session ID to get context for' },
|
|
},
|
|
required: ['session_id'],
|
|
},
|
|
},
|
|
{
|
|
name: 'build_record',
|
|
description: 'Record build information linked to session',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
session_id: { type: 'string', description: 'Session ID (optional)' },
|
|
version_id: { type: 'string', description: 'Version ID being built' },
|
|
build_number: { type: 'number', description: 'Build number' },
|
|
git_commit_sha: { type: 'string', description: 'Git commit SHA' },
|
|
status: { type: 'string', description: 'Build status (pending, running, success, failed)' },
|
|
started_at: { type: 'string', description: 'Build start timestamp (ISO format)' },
|
|
},
|
|
required: ['version_id', 'build_number', 'status', 'started_at'],
|
|
},
|
|
},
|
|
{
|
|
name: 'session_commit_link',
|
|
description: 'Link a commit to a session',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
session_id: { type: 'string', description: 'Session ID' },
|
|
commit_sha: { type: 'string', description: 'Git commit SHA' },
|
|
repo: { type: 'string', description: 'Repository' },
|
|
commit_message: { type: 'string', description: 'Commit message (optional)' },
|
|
committed_at: { type: 'string', description: 'Commit timestamp (ISO format, optional)' },
|
|
},
|
|
required: ['session_id', 'commit_sha', 'repo'],
|
|
},
|
|
},
|
|
{
|
|
name: 'session_recover_orphaned',
|
|
description: 'Recover abandoned/orphaned sessions (active >2 hours)',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
project: { type: 'string', description: 'Project key to filter by (optional)' },
|
|
},
|
|
},
|
|
},
|
|
{
|
|
name: 'session_recover_temp_notes',
|
|
description: 'Recover notes from temp files for a specific session',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
session_id: { type: 'string', description: 'Session ID to recover notes for' },
|
|
temp_file_path: { type: 'string', description: 'Path to .claude-session/*/notes.md file' },
|
|
},
|
|
required: ['session_id', 'temp_file_path'],
|
|
},
|
|
},
|
|
|
|
// Session Documentation Tools
|
|
{
|
|
name: 'session_note_add',
|
|
description: 'Add a note to current session with auto-generated embedding',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
session_id: { type: 'string', description: 'Session ID' },
|
|
note_type: { type: 'string', enum: ['accomplishment', 'decision', 'gotcha', 'next_steps', 'context'], description: 'Category of note' },
|
|
content: { type: 'string', description: 'Note content' },
|
|
},
|
|
required: ['session_id', 'note_type', 'content'],
|
|
},
|
|
},
|
|
{
|
|
name: 'session_notes_list',
|
|
description: 'List all notes for a session',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
session_id: { type: 'string', description: 'Session ID' },
|
|
note_type: { type: 'string', enum: ['accomplishment', 'decision', 'gotcha', 'next_steps', 'context'], description: 'Filter by note type (optional)' },
|
|
},
|
|
required: ['session_id'],
|
|
},
|
|
},
|
|
{
|
|
name: 'session_plan_save',
|
|
description: 'Save a plan to database with semantic embedding',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
session_id: { type: 'string', description: 'Session ID' },
|
|
plan_content: { type: 'string', description: 'Plan content in markdown' },
|
|
plan_file_name: { type: 'string', description: 'Original filename (optional)' },
|
|
status: { type: 'string', enum: ['draft', 'approved', 'executed', 'abandoned'], description: 'Plan status (default: draft)' },
|
|
},
|
|
required: ['session_id', 'plan_content'],
|
|
},
|
|
},
|
|
{
|
|
name: 'session_plan_update_status',
|
|
description: 'Update plan status (draft → approved → executed)',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
plan_id: { type: 'number', description: 'Plan ID to update' },
|
|
status: { type: 'string', enum: ['draft', 'approved', 'executed', 'abandoned'], description: 'New status' },
|
|
},
|
|
required: ['plan_id', 'status'],
|
|
},
|
|
},
|
|
{
|
|
name: 'session_plan_list',
|
|
description: 'List plans for a session',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
session_id: { type: 'string', description: 'Session ID' },
|
|
status: { type: 'string', enum: ['draft', 'approved', 'executed', 'abandoned'], description: 'Filter by status (optional)' },
|
|
},
|
|
required: ['session_id'],
|
|
},
|
|
},
|
|
{
|
|
name: 'project_doc_upsert',
|
|
description: 'Create or update project documentation',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
project: { type: 'string', description: 'Project key' },
|
|
doc_type: { type: 'string', enum: ['overview', 'architecture', 'guidelines', 'history', 'configuration', 'workflow'], description: 'Documentation type' },
|
|
title: { type: 'string', description: 'Document title' },
|
|
content: { type: 'string', description: 'Document content in markdown' },
|
|
session_id: { type: 'string', description: 'Session ID (optional)' },
|
|
},
|
|
required: ['project', 'doc_type', 'title', 'content'],
|
|
},
|
|
},
|
|
{
|
|
name: 'project_doc_get',
|
|
description: 'Get specific project documentation by type',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
project: { type: 'string', description: 'Project key' },
|
|
doc_type: { type: 'string', enum: ['overview', 'architecture', 'guidelines', 'history', 'configuration', 'workflow'], description: 'Documentation type' },
|
|
},
|
|
required: ['project', 'doc_type'],
|
|
},
|
|
},
|
|
{
|
|
name: 'project_doc_list',
|
|
description: 'List all documentation for a project',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
project: { type: 'string', description: 'Project key' },
|
|
},
|
|
required: ['project'],
|
|
},
|
|
},
|
|
{
|
|
name: 'session_documentation_generate',
|
|
description: 'Auto-generate full markdown documentation for a session',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
session_id: { type: 'string', description: 'Session ID' },
|
|
},
|
|
required: ['session_id'],
|
|
},
|
|
},
|
|
{
|
|
name: 'session_semantic_search',
|
|
description: 'Search across all session documentation using hybrid (vector + keyword), vector-only, or keyword-only search. Supports optional metadata filters (topics, projects, issue_keys) — only use filters when the user explicitly mentions a topic/project. When unsure, search without filters.',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
query: { type: 'string', description: 'Search query' },
|
|
project: { type: 'string', description: 'Filter by project (optional)' },
|
|
limit: { type: 'number', description: 'Max results (default: 10)' },
|
|
search_mode: { type: 'string', enum: ['hybrid', 'vector', 'keyword'], description: 'Search mode (default: hybrid)' },
|
|
filter_topics: { type: 'array', items: { type: 'string' }, description: 'Filter by extracted topics (e.g., ["pgvector", "deployment"]). Only use when user explicitly mentions topics.' },
|
|
filter_projects: { type: 'array', items: { type: 'string' }, description: 'Filter by extracted project keys (e.g., ["CF", "BAB"]). Only use when user explicitly mentions projects.' },
|
|
filter_issue_keys: { type: 'array', items: { type: 'string' }, description: 'Filter by extracted Jira issue keys (e.g., ["CF-1307"]). Only use when user explicitly mentions issue keys.' },
|
|
},
|
|
required: ['query'],
|
|
},
|
|
},
|
|
{
|
|
name: 'session_productivity_analytics',
|
|
description: 'Get productivity metrics',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
project: { type: 'string', description: 'Filter by project (optional)' },
|
|
time_period: { type: 'string', enum: ['week', 'month', 'quarter'], description: 'Time period (default: month)' },
|
|
},
|
|
},
|
|
},
|
|
{
|
|
name: 'session_pattern_detection',
|
|
description: 'Detect patterns across sessions',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
project: { type: 'string', description: 'Filter by project (optional)' },
|
|
pattern_type: { type: 'string', enum: ['tool_usage', 'task_types', 'error_frequency'], description: 'Type of pattern to detect' },
|
|
},
|
|
},
|
|
},
|
|
|
|
// Transcript Tools (CF-2394)
|
|
{
|
|
name: 'session_transcript_search',
|
|
description: 'Search session transcripts (JSONL) using hybrid (vector + keyword) search. Finds past sessions by content — commands run, decisions made, plans discussed. Use when recovering context from prior sessions.',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
query: { type: 'string', description: 'Search query (e.g., "hetzner disk resize", "auth migration plan")' },
|
|
project: { type: 'string', description: 'Filter by project key (optional)' },
|
|
session_issue_key: { type: 'string', description: 'Filter by session Jira issue key (optional)' },
|
|
limit: { type: 'number', description: 'Max results (default: 10)' },
|
|
search_mode: { type: 'string', enum: ['hybrid', 'vector', 'keyword'], description: 'Search mode (default: hybrid)' },
|
|
},
|
|
required: ['query'],
|
|
},
|
|
},
|
|
|
|
// Archive Tools
|
|
{
|
|
name: 'archive_add',
|
|
description: 'Archive content to database with semantic embedding.',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
project: { type: 'string', description: 'Project key' },
|
|
archive_type: { type: 'string', enum: ['session', 'research', 'audit', 'investigation', 'completed', 'migration'], description: 'Archive type' },
|
|
title: { type: 'string', description: 'Archive title' },
|
|
content: { type: 'string', description: 'Archive content (markdown)' },
|
|
original_path: { type: 'string', description: 'Original file path (optional)' },
|
|
file_size: { type: 'number', description: 'File size in bytes (optional)' },
|
|
archived_by_session: { type: 'string', description: 'Session ID (optional)' },
|
|
metadata: { type: 'object', description: 'Additional metadata (optional)' },
|
|
},
|
|
required: ['project', 'archive_type', 'title', 'content'],
|
|
},
|
|
},
|
|
{
|
|
name: 'archive_search',
|
|
description: 'Search archives using hybrid (vector + keyword), vector-only, or keyword-only search.',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
query: { type: 'string', description: 'Search query' },
|
|
project: { type: 'string', description: 'Filter by project (optional)' },
|
|
archive_type: { type: 'string', enum: ['session', 'research', 'audit', 'investigation', 'completed', 'migration'], description: 'Filter by archive type (optional)' },
|
|
limit: { type: 'number', description: 'Max results (default: 5)' },
|
|
search_mode: { type: 'string', enum: ['hybrid', 'vector', 'keyword'], description: 'Search mode (default: hybrid)' },
|
|
},
|
|
required: ['query'],
|
|
},
|
|
},
|
|
{
|
|
name: 'archive_list',
|
|
description: 'List archives with optional filters',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
project: { type: 'string', description: 'Filter by project (optional)' },
|
|
archive_type: { type: 'string', enum: ['session', 'research', 'audit', 'investigation', 'completed', 'migration'], description: 'Filter by archive type (optional)' },
|
|
since: { type: 'string', description: 'Show archives since date (ISO format, optional)' },
|
|
limit: { type: 'number', description: 'Max results (default: 20)' },
|
|
},
|
|
},
|
|
},
|
|
{
|
|
name: 'archive_get',
|
|
description: 'Get full content of specific archive by ID',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
id: { type: 'number', description: 'Archive ID' },
|
|
},
|
|
required: ['id'],
|
|
},
|
|
},
|
|
|
|
// Project Archival
|
|
{
|
|
name: 'project_archive',
|
|
description: 'Archive complete project to S3 with database tracking.',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
project_key: { type: 'string', description: 'Project key' },
|
|
project_path: { type: 'string', description: 'Absolute path to project directory' },
|
|
delete_local: { type: 'boolean', description: 'Delete local project after successful archive (default: false)' },
|
|
session_id: { type: 'string', description: 'Session ID performing the archival (optional)' },
|
|
},
|
|
required: ['project_key', 'project_path'],
|
|
},
|
|
},
|
|
];
|