Skip to content

Comments

Feature/first use case#4

Merged
akisma merged 7 commits intomainfrom
feature/first-use-case
Jan 5, 2026
Merged

Feature/first use case#4
akisma merged 7 commits intomainfrom
feature/first-use-case

Conversation

@akisma
Copy link
Owner

@akisma akisma commented Jan 4, 2026

adds all that we can actually accomplish for a reasonable TM use case. includes refactors and cleanups as we move into semi-functional mode. also adds basic CI to run tests with each PR.

Add CI workflow for PR/push, create tsconfig.test.json with allowImportingTsExtensions, fix mock data types, add VS Code settings
…ta + text

Add typed output interfaces, update 127 tests, update all docs, add GitHub Actions CI
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements Phase 4 of the Mastertour MCP server, adding venue research capabilities and completing a major architecture refactoring. The PR adds 3 new venue-focused tools, introduces structured output types across all 12 tools, implements dependency injection for better testability, and establishes CI/CD with GitHub Actions.

Key Changes:

  • Added venue research tools: search_past_venues, get_venue_details, get_upcoming_shows
  • Refactored to use dependency injection pattern with singleton client instance
  • Introduced structured ToolResult<T> return type for all tools providing both typed data and human-readable text
  • Created shared utilities: formatters module and tour iterator for code reuse
  • Established GitHub Actions CI workflow with Node 20.x/22.x matrix testing

Reviewed changes

Copilot reviewed 44 out of 45 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/config.ts New configuration module with fail-fast validation for environment variables
src/auth/oauth.ts Refactored OAuth client to support explicit credential injection
src/index.ts Refactored server initialization to use dependency injection pattern
src/types/outputs.ts New structured output type definitions for all tool return values
src/utils/formatters.ts Shared formatting utilities (dates, fields, contacts, search normalization)
src/utils/tourIterator.ts Async generator for iterating tours/days with filtering
src/tools/searchPastVenues.ts New tool for searching venues from historical tours
src/tools/getVenueDetails.ts New tool for retrieving complete venue information
src/tools/getUpcomingShows.ts New tool for listing upcoming shows across tours
src/tools/*.ts (updates) All existing tools updated to return ToolResult<T> structured outputs
src/api/client.ts Added getTourAll and getDayEvents methods for venue research
tests/**/*.test.ts Updated imports from .js to .ts, assertions changed to use result.text
.github/workflows/ci.yml New GitHub Actions CI workflow
vitest.config.ts Added typecheck configuration
tsconfig.test.json New TypeScript config for test files
docs/*.md Updated documentation reflecting Phase 4 completion and architecture changes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

},
};

const mockDayEvents: Record<string, any[]> = {
Copy link

Copilot AI Jan 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using any[] for the type defeats TypeScript's type safety. Consider using a more specific type like DayEvent[] or creating a proper mock type.

Copilot uses AI. Check for mistakes.
const contacts: VenueContactOutput[] = extractContacts(venueEvent.venueContacts);

const data: VenueDetailsOutput = {
dayId: venueId, // Using venueId as identifier
Copy link

Copilot AI Jan 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue as in searchPastVenues: the dayId field is being assigned venueId instead of an actual day ID. This creates confusion about what the field represents. Consider renaming to venueId in the output type or storing the actual day ID.

Suggested change
dayId: venueId, // Using venueId as identifier
dayId: venueEvent.dayId,

Copilot uses AI. Check for mistakes.
* reducing code duplication in venue research tools.
*/

import type { MasterTourClient, TourInfo, EventDayInfo, DayEvent, TourAllResponse } from '../api/client.js';
Copy link

Copilot AI Jan 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import uses .js extension for TypeScript files, but this might be inconsistent with other imports in the codebase. Consider whether imports should consistently use .ts extensions for TypeScript source files, especially given that test files have been updated to use .ts extensions.

Suggested change
import type { MasterTourClient, TourInfo, EventDayInfo, DayEvent, TourAllResponse } from '../api/client.js';
import type { MasterTourClient, TourInfo, EventDayInfo, DayEvent, TourAllResponse } from '../api/client.ts';

Copilot uses AI. Check for mistakes.

// Build structured data
const outputResults: VenueSearchResultOutput[] = results.map((v) => ({
dayId: v.venueId, // Using venueId as dayId since we don't track specific days
Copy link

Copilot AI Jan 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dayId field is being misused here - it's assigned the venueId instead of an actual day ID. This creates a misleading API where the field name doesn't match the data. Consider either renaming the field in VenueSearchResultOutput to venueId, or storing the actual day ID where this venue was found.

Suggested change
dayId: v.venueId, // Using venueId as dayId since we don't track specific days
dayId: '', // No specific day ID is tracked for these aggregated venue results

Copilot uses AI. Check for mistakes.
expect(mockClient.getTourSummary).toHaveBeenCalledWith('tour123', today);
});
});
});;
Copy link

Copilot AI Jan 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a double semicolon at the end of this line. Remove one semicolon.

Copilot uses AI. Check for mistakes.
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Comment on lines +39 to +42
MASTERTOUR_CONSUMER_KEY: test-key
MASTERTOUR_CONSUMER_SECRET: test-secret
MASTERTOUR_ACCESS_TOKEN: test-token
MASTERTOUR_TOKEN_SECRET: test-secret
Copy link

Copilot AI Jan 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The environment variables in the CI workflow don't match the actual configuration used by the application. The code uses MASTERTOUR_KEY and MASTERTOUR_SECRET (from config.ts), but the CI workflow sets MASTERTOUR_CONSUMER_KEY, MASTERTOUR_CONSUMER_SECRET, MASTERTOUR_ACCESS_TOKEN, and MASTERTOUR_TOKEN_SECRET. This mismatch will cause CI tests to fail if they rely on environment configuration.

Suggested change
MASTERTOUR_CONSUMER_KEY: test-key
MASTERTOUR_CONSUMER_SECRET: test-secret
MASTERTOUR_ACCESS_TOKEN: test-token
MASTERTOUR_TOKEN_SECRET: test-secret
MASTERTOUR_KEY: test-key
MASTERTOUR_SECRET: test-secret

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Copilot AI commented Jan 5, 2026

@akisma I've opened a new pull request, #5, to work on those changes. Once the pull request is ready, I'll request review from you.

[WIP] Update to address feedback on Feature/first use case PR
@akisma akisma merged commit d3d55b5 into main Jan 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants