get_object
Retrieve detailed information about a specific object by its ID, including metadata, relationships, content, activity history, and file associations. Essential for task context review, status checks, and dependency verification.
Instructions
Gets an object from the task trellis system
Use this tool to retrieve detailed information about a specific object by its unique ID. Returns the complete object data including metadata, relationships, content, and activity history.
Key information retrieved:
Object metadata (type, title, status, priority, timestamps)
Hierarchical relationships (parent, children, prerequisites)
Content body and description
Activity log and change history
File associations and modifications
Current state and progress indicators
Usage scenarios:
Review task details before starting work
Check object status and dependencies
Examine change history and activity logs
Understand parent-child relationships
Verify prerequisite completion
Access associated file changes
Essential for understanding the full context of a work item before making modifications or planning next steps.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ID of the object to retrieve |
Input Schema (JSON Schema)
Implementation Reference
- src/tools/getObjectTool.ts:38-81 (handler)Handler function that retrieves an object by ID from the repository, serializes it, and returns as MCP content block. Handles not found and errors.export async function handleGetObject(repository: Repository, args: unknown) { const { id } = args as { id: string; }; try { const object = await repository.getObjectById(id); if (!object) { return { content: [ { type: "text", text: `Object with ID "${id}" not found`, }, ], }; } // Convert Map objects to plain objects for proper JSON serialization const serializedObject = { ...object, affectedFiles: Object.fromEntries(object.affectedFiles), }; return { content: [ { type: "text", text: `Retrieved object: ${JSON.stringify(serializedObject, null, 2)}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error retrieving object with ID "${id}": ${error instanceof Error ? error.message : String(error)}`, }, ], }; } }
- src/tools/getObjectTool.ts:3-36 (schema)Tool definition object with name 'get_issue', detailed description, and inputSchema requiring 'id' string.export const getObjectTool = { name: "get_issue", description: `Gets an issue from the task trellis system Use this tool to retrieve detailed information about a specific issue by its unique ID. Returns the complete issue data including metadata, relationships, content, and activity history. Key information retrieved: - Issue metadata (type, title, status, priority, timestamps) - Hierarchical relationships (parent, children, prerequisites) - Content body and description - Activity log and change history - File associations and modifications - Current state and progress indicators Usage scenarios: - Review task details before starting work - Check issue status and dependencies - Examine change history and activity logs - Understand parent-child relationships - Verify prerequisite completion - Access associated file changes Essential for understanding the full context of a work item before making modifications or planning next steps.`, inputSchema: { type: "object", properties: { id: { type: "string", description: "ID of the issue to retrieve", }, }, required: ["id"], }, } as const;
- src/server.ts:176-197 (registration)Registration in ListToolsRequestSchema handler: getObjectTool included in the tools array returned to clients.server.setRequestHandler(ListToolsRequestSchema, () => { const tools: unknown[] = [ createObjectTool, updateObjectTool, getObjectTool, deleteObjectTool, listObjectsTool, appendObjectLogTool, appendModifiedFilesTool, claimTaskTool, getNextAvailableIssueTool, completeTaskTool, ]; // Only include activate tool if server is not properly configured from command line // (i.e., local mode without projectRootFolder specified) if (serverConfig.mode === "local" && !serverConfig.planningRootFolder) { tools.push(activateTool); } return { tools }; });
- src/server.ts:200-279 (registration)Registration in CallToolRequestSchema handler: case "get_issue" calls handleGetObject with repository and args.server.setRequestHandler(CallToolRequestSchema, (request) => { const { name: toolName, arguments: args } = request.params; // Validate that local mode requires planning root folder for all tools except activate if ( serverConfig.mode === "local" && !serverConfig.planningRootFolder && toolName !== "activate" ) { return { content: [ { type: "text", text: "Planning root folder is not configured. Please call the 'activate' tool with the project's root folder first.", }, ], }; } if (toolName === "activate") { const { mode, projectRoot, apiToken, url, remoteProjectId } = args as { mode: "local" | "remote"; projectRoot?: string; apiToken?: string; url?: string; remoteProjectId?: string; }; // Update server config based on activate parameters serverConfig.mode = mode; if (mode === "local" && projectRoot) { serverConfig.planningRootFolder = path.join(projectRoot, ".trellis"); } else if (mode === "remote") { if (url) serverConfig.remoteRepositoryUrl = url; if (apiToken) serverConfig.remoteRepositoryApiToken = apiToken; if (remoteProjectId) serverConfig.remoteProjectId = remoteProjectId; } return { content: [ { type: "text", text: `Activated in ${mode} mode. Server config updated: ${JSON.stringify( serverConfig, null, 2, )}`, }, ], }; } const repository = getRepository(); switch (toolName) { case "create_issue": return handleCreateObject(_getService(), repository, args); case "update_issue": return handleUpdateObject(_getService(), repository, args, serverConfig); case "get_issue": return handleGetObject(repository, args); case "delete_issue": return handleDeleteObject(repository, args); case "list_issues": return handleListObjects(_getService(), repository, args); case "append_issue_log": return handleAppendObjectLog(_getService(), repository, args); case "append_modified_files": return handleAppendModifiedFiles(_getService(), repository, args); case "claim_task": return handleClaimTask(_getService(), repository, args); case "get_next_available_issue": return handleGetNextAvailableIssue(_getService(), repository, args); case "complete_task": return handleCompleteTask(_getService(), repository, args, serverConfig); case "activate": default: throw new Error(`Unknown tool: ${toolName}`); }
- src/tools/index.ts:18-18 (registration)Re-export of getObjectTool and handleGetObject from getObjectTool.ts for easy import in server.ts.export { getObjectTool, handleGetObject } from "./getObjectTool.js";