KANSAS CITY, Mo. >> Coming off their most disappointing home stand of the season, Bob Melvin had a directive for his club.

“We realized that we can’t just let the season end,” the Giants’ skipper said before their series finale against the Royals. “We’ve got to win some games and dig a little bit harder.”

Message received.

On the same road trip they were mathematically eliminated from postseason contention, there’s a strong case to be made the Giants are playing their best baseball of the season. Their series against the playoff-hopeful Royals ended the same way as their series against another American League contender began, with a shutout win — 2-0 — behind Blake Snell at his very best.

Snell yielded just two hits and one walk over six shutout innings while striking out nine as the Giants swept only their third series of the season. The damp Sunday matinee represented the Giants’ 12th chance this season to complete a sweep but they had been successful only in their two tries against the lowly Rockies.

Through the first six games of their final road trip of the season, the Giants are 5-1 and outscoring their opponents 31-9.

Snell issued his lone walk to lead off the second inning, then responded by striking out the next five hitters he faced, coming one shy of his sixth game in double-digits this season, trailing Chris Sale, Garrett Crochet and Tyler Glasnow, despite his first only coming July 27.

In 12 starts since returning from the injured list July 9, Snell has a 1.23 ERA with 114 strikeouts in 80 1/3 innings. With one start left this season, he has lowered his season ERA in the 20 total times he’s taken the mound to 3.12, after it sat at 9.51 when he landed on the IL for a second time June 2.

As a team, the Giants have thrown three shutouts through the first six games of the trip after doing it eight times in their first 150 games of the season. After a 9-0 win Saturday, they recorded back-to-back shutouts for the first time since July 31-Aug. 2.

They’ve limited the Royals and Orioles to nine runs in six games, a team ERA of 1.51.

After a sloppy home stand in the field, they also have gone the first six games of the trip without committing an error.

And although their bats produced only two runs in Sunday’s series finale, they have recorded two of their top 13 single-game outputs of the season and scored first in every contest. The offense also woke up after being shut out three times while dropping their previous four games at Oracle Park.

Against Seth Lugo, who shared a rotation with Snell under Melvin in San Diego last season, the Giants put up a two-spot in the second inning.

Jerar Encarnacion got things started with a sharp single to center field and scored from first base when Grant McCray tripled into the gap in right-center field. With the speedy McCray on third, Tyler Fitzgerald went down swinging, but Brett Wisely delivered a piece of timely hitting to extend the lead to 2-0, poking a two-strike, two-out curveball to left field.